Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat][CometD] Resolve Retry Error Handling #34327

Merged
merged 15 commits into from
Feb 22, 2023

Conversation

kush-elastic
Copy link
Collaborator

@kush-elastic kush-elastic commented Jan 20, 2023

  • Bug

What does this PR do?

Filebeat CometD input is closing input worker in case of client-server connection issue with EOF error.
Current forked bayeux library is sending error message while any connection issues from salesforce side. which in return CometD is assuming it to be un recoverable error and closing the input worker.
This PR contains draft changes for handling above mentioned issue.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Logs

{"log.level":"error","@timestamp":"2023-01-20T16:17:09.542+0530","log.logger":"cometd","log.origin":{"file.name":"cometd/input.go","file.line":46},"message":"got error while running input","service.name":"filebeat","pubsub_channel":"channel_name","error":{"message":"error collecting events: cannot connect to bayeux: bad unrecoverable call: Post "[http://localhost:8080/cometd/38.0](http://localhost:8080/cometd/38.0%5C)": EOF, trying again"},"ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-01-20T16:17:09.543+0530","log.logger":"cometd","log.origin":{"file.name":"cometd/input.go","file.line":47},"message":"Input worker has stopped.","service.name":"filebeat","pubsub_channel":"channel_name","ecs.version":"1.6.0"}

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 20, 2023
@kush-elastic kush-elastic requested a review from a team January 20, 2023 11:02
@kush-elastic kush-elastic self-assigned this Jan 20, 2023
@mergify
Copy link
Contributor

mergify bot commented Jan 20, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @kush-elastic? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 20, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 20, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-02-16T04:35:05.644+0000

  • Duration: 73 min 26 sec

Test stats 🧪

Test Results
Failed 0
Passed 2865
Skipped 172
Total 3037

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@andrewkroh andrewkroh added Team:Service-Integrations Label for the Service Integrations team and removed Team:Security-External Integrations labels Jan 24, 2023
@kush-elastic kush-elastic marked this pull request as ready for review January 31, 2023 12:32
@kush-elastic kush-elastic requested a review from a team as a code owner January 31, 2023 12:32
@kush-elastic kush-elastic requested review from rdner and cmacknz and removed request for a team January 31, 2023 12:32
Copy link
Member

@rdner rdner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all the change looks good to me but I'd like to ask another pair of eyes from someone who knows the area very well.

@mergify
Copy link
Contributor

mergify bot commented Feb 3, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b bayeux_changes upstream/bayeux_changes
git merge upstream/main
git push upstream bayeux_changes

@kush-elastic kush-elastic requested a review from rdner February 3, 2023 05:46
@cmacknz cmacknz removed their request for review February 6, 2023 20:23
@mergify
Copy link
Contributor

mergify bot commented Feb 7, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b bayeux_changes upstream/bayeux_changes
git merge upstream/main
git push upstream bayeux_changes

@P1llus
Copy link
Member

P1llus commented Feb 14, 2023

Unless there is anything more, we should merge @agithomas @rdner @efd6 ?

@kush-elastic kush-elastic requested a review from P1llus February 14, 2023 12:56
@mergify
Copy link
Contributor

mergify bot commented Feb 16, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b bayeux_changes upstream/bayeux_changes
git merge upstream/main
git push upstream bayeux_changes

Copy link
Contributor

@agithomas agithomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@agithomas agithomas merged commit 47723fe into elastic:main Feb 22, 2023
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* resolve retry error handling

* add retry in input worker

* added unit test for testing EOF error retry in cometd input

* resolve golangci-lint errors

* introduce SObject extraction as well

* improved logging

* salesforce force fully closing connection for the case of timeouts

* channel creation for each new iteration to avoid unnecessary channel close panics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Service-Integrations Label for the Service Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants