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] Filebeat CometD input closes Filebeat worker while getting connection or EOF error from bayeux library #34326

Closed
kush-elastic opened this issue Jan 20, 2023 · 3 comments
Assignees

Comments

@kush-elastic
Copy link
Collaborator

kush-elastic commented Jan 20, 2023

Description:

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 in the Filebeat.

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\": 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"}

Solution:

Need to manage errors or in this case can be called warnings should be explicitly handled to not close the input and continue trying to collecting data from CometD.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 20, 2023
@kush-elastic kush-elastic self-assigned this Jan 20, 2023
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 20, 2023
@kush-elastic kush-elastic added enhancement needs_team Indicates that the issue/PR needs a Team:* label labels Jan 20, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 20, 2023
@botelastic
Copy link

botelastic bot commented Jan 20, 2023

This issue doesn't have a Team:<team> label.

@kush-elastic
Copy link
Collaborator Author

CometD input does not have restart on failures. which is case worker is not getting restarted even if user has not explicitly closed Filebeat.

Solution:

  • Add worker context closer condition to restart worker each time if user has not sent signal for closing the filebeat(which here can be checked using worker context).
  • Add channel handler for each iteration.
  • Add rate limit with wait time to each restart of input worker.

@kush-elastic kush-elastic changed the title [Filebeat][CometD] Filebeat CometD input closes Filebeat while getting connection or EOF error from bayeux library [Filebeat][CometD] Filebeat CometD input closes Filebeat worker while getting connection or EOF error from bayeux library Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants