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
Fix non-zero exit code when receiving remote shutdown #8650
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8650 +/- ##
=======================================
Coverage 87.33% 87.33%
=======================================
Files 148 148
Lines 18515 18515
Branches 3163 3163
=======================================
Hits 16170 16170
Misses 2060 2060
Partials 285 285
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@auvipy check out this PR! Indeed |
Do you want to include it in 5.3.6 @auvipy? |
Im open to include it |
Awesome! |
I am working on a new massive version for the Test Casedef test_shutdown_exit_with_zero(self, celery_setup: CeleryTestSetup):
celery_setup.app.control.shutdown()
while celery_setup.worker.container.status != "exited":
celery_setup.worker.container.reload()
assert celery_setup.worker.container.attrs['State']['ExitCode'] == 0 Running on
|
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.
Very important bugfix !!
APPROVED
thanks a lot! both of you!!! |
Description
Possibly fixes #8540.
This issue likely surfaced with #7544. Since
WorkerShutdown
inherits fromSystemExit
, providing a non-integer value results in an exit code of 1. This exception is then propagated tocelery/celery/worker/worker.py
Line 209 in bad2750
which causes a non-zero exit code upon a graceful shutdown request of the worker.