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
SQS messages can be dropped during shutdown #1819
Comments
@rafidka any insight to share? |
I don't have an easy repro of actually losing events, I'll work on that. What I've done is add debug prints in |
You'd expect the worker to immediately process the dispatched task, but instead it only does so after the visibility timeout expires. |
When celery is stopped gracefully, the in-flight request to SQS is not completed. If SQS returns messages for this request it considers them delivered, but Celery doesn't do anything with them (even if
task_reject_on_worker_lost
is set). SQS will redeliver the message when the visibility timeout expires, but this isn't great for a graceful shutdown.SQS uses
CurlClient
to make requests, which usescelery.worker.loops.asynloop
to do IO. The event loop is the first thing to stop whenSIGTERM/SIGINT
is received, and so in-flight requests are simply dropped.The text was updated successfully, but these errors were encountered: