-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] Improve error message when handleSQSMessage failed #14113
Conversation
@exekias Sorry I messed up my previous PR so I'm responding to your question here instead. I don't think it's a good idea to keep reading the same non-valid message from the queue again and again every time there is a new message coming in. I added a |
Working on fixing the failing test. |
That would make Filebeat memory grow without bounds, as the list of ignored items could keep growing forever. I wonder if we should still remove the message but show an error to the user explaining what happened? This looks like a bad configuration, we should not get anything but S3 notifications on these queues |
@exekias Good point! Definitely don't want filebeat memory to grow out of bound. I removed the blacklist option and improved the log message so it's clear what went wrong. |
p.logger.Error(err) | ||
errC <- err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching the order here so the error message get logged first and then send to error channel. Otherwise the error log never get published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides changelog issues
…c#14113) * Add message id to debug log
…en handleSQSMessage failed (elastic#14248) * [Filebeat] Improve error message when handleSQSMessage failed (elastic#14113) * Add message id to debug log (cherry picked from commit f6a19eb) * run mage fmt under x-pack/libbeat
When a message in SQS is not created by s3 or event name doesn't start with ObjectCreated, this message will be removed and log a more clearer error message. Also added debug log when message is removed.