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

Ensure non-zero exit code when startup fails #1278

Merged
merged 4 commits into from
Dec 6, 2021

Conversation

Kludex
Copy link
Sponsor Member

@Kludex Kludex commented Dec 4, 2021

This PR proposes that running uvicorn without --workers and --reload at startup failure will exit with code 3.

The reasoning for the number 3 is to differentiate from the general exit code, and to match gunicorn's decision (consensus).

What about --workers and --reload?

Well, using --workers you actually don't exit at startup failure yet. See #1115

As for the --reload, what do you recommend @euri10 ? server.started is always False on the main.run() because target=server.run runs in another process. Until #1177 (not released yet), on startup failure it didn't exit as well.

@Kludex Kludex mentioned this pull request Dec 4, 2021
4 tasks
@Kludex Kludex requested a review from euri10 December 4, 2021 13:58
@Kludex
Copy link
Sponsor Member Author

Kludex commented Dec 4, 2021

@euri10 ping

@Kludex Kludex merged commit 825aeba into encode:master Dec 6, 2021
Kludex added a commit to sephioh/uvicorn that referenced this pull request Oct 29, 2022
* Ensure non-zero exit code when startup fails

* Make sure it only works on standalone uvicorn run

* Fix test

* Rename constant name
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.

None yet

2 participants