Skip to content
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 resetting signals in Gunicorn UvicornWorker #895

Merged
merged 2 commits into from
Dec 29, 2020

Conversation

tiangolo
Copy link
Sponsor Member

@tiangolo tiangolo commented Dec 14, 2020

🐛 Fix resetting signals in Gunicorn UvicornWorker to fix subprocesses that capture output having an incorrect returncode.

Fixes #894

Very short version:

When starting Gunicorn with Uvicorn worker(s), if the app uses subprocess to start other processes and captures the output, their returncode is in most cases 0, even if the actual exit code was 1.

Lengthy explanation and self-contained reproducible example in this issue: #894

to fix subprocesses that capture output having an incorrect returncode
uvicorn/workers.py Outdated Show resolved Hide resolved
Copy link
Member

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great debugging, writeup and resolution! Thanks @tiangolo.

uvicorn/workers.py Show resolved Hide resolved
@florimondmanca florimondmanca mentioned this pull request Dec 29, 2020
@florimondmanca florimondmanca merged commit 36cfe87 into encode:master Dec 29, 2020
@tiangolo tiangolo deleted the gunicorn-uvicorn-subprocess branch December 29, 2020 16:19
@tiangolo
Copy link
Sponsor Member Author

Woohoo! Thanks @florimondmanca for checking, updating, and merging this! 🚀 🤓 🍰 ☕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subprocess returncode is not detected when running Gunicorn with Uvicorn (with fix PR companion)
3 participants