-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Exit with status 3 when worker starts failed #1077
Conversation
@fanchunke1991 you can use the |
@euri10 my bad, I have already used |
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.
Looks good to me, solves the issue at end,
However I'd like to give it for other reviewers a little more time
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.
Hey @fanchunke1991 ! 👋
Thanks for the PR! 🎉
I'm quite worried about magic numbers, and the round trip to found information about them. If we could reference the same variable that gunicorn
uses, it will be great. Do you mind taking a look at the suggestion?
@fanchunke1991 Thanks for PR! 🎉 |
* fix: exit with status 3 when worker starts failed to aviod infinite start/stop cycles * docs: fixes spelling error * style: lint the code * fix: replace magic exit code Co-authored-by: fanchunke <fanchunke@laiye.com>
* fix: exit with status 3 when worker starts failed to aviod infinite start/stop cycles * docs: fixes spelling error * style: lint the code * fix: replace magic exit code Co-authored-by: fanchunke <fanchunke@laiye.com>
This PR fixes #1066 .
When starting Gunicorn with Uvicorn worker, if exceptions raised at startup events,
UvicornWorker
exits with zero exit code, therefore Gunicorn will keep booting worker.This PR sets exit code 3 when worker starts failed, Gunicorn will then handle
SIGCHLD
correctly and could shut it down to avoid infinite start/stop cycles.