-
Notifications
You must be signed in to change notification settings - Fork 40
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
Plugin won't shutdown if no events coming through the SQS queue #33
Comments
+1. I've been trying to track down why logstash was unable to shut down gracefully certain hosts. Turns out that this was the cause of it, since on those hosts in question, they have an SQS queue input that rarely receives input. I can confirm that applying a patch like the one below addresses the problem
|
…e arrived in the queue. Fixes logstash-plugins#33
This is causing noisy logs for us before our logstash containers hit their SIGTERM timeout of 5 minutes and get SIGKILLed. It'd be nice to get a fix merged. |
This still appears to be a problem in Logstash 7.9.1 and logstash-input-sqs 3.1.2. |
Still a problem, is it possible to merge the PR? |
Fixes: logstash-plugins#33 Closes: logstash-plugins#40 Co-authored-by: Daniel Popescu <[email protected]>
Fixes: logstash-plugins#33 Closes: logstash-plugins#40 Co-authored-by: Daniel Popescu <[email protected]>
I've noticed that if an SQS queue has no events flowing through it, then the plugin won't shut down.
The use case I have for a queue without events flowing through it is that I use SQS as a fallback transport, and only send data through it when my primary transport is down or having issues streaming.
Looking at the code, it seems that breaking out of the polling loop happens only when there are messages to loop through:
https://github.com/logstash-plugins/logstash-input-sqs/blob/master/lib/logstash/inputs/sqs.rb#L143
seems there needs to be a before_request callback (http://docs.aws.amazon.com/sdkforruby/api/Aws/SQS/QueuePoller.html#before_request-instance_method) that checks for stopped and throws ':stop_polling' to break out of the processing loop even if there are no events flowing through the queue.
The text was updated successfully, but these errors were encountered: