-
-
Notifications
You must be signed in to change notification settings - Fork 754
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
New multiprocess manager #2183
New multiprocess manager #2183
Conversation
pyproject.toml
Outdated
@@ -100,7 +100,7 @@ omit = [ | |||
|
|||
[tool.coverage.report] | |||
precision = 2 | |||
fail_under = 98.35 | |||
fail_under = 96.82 |
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.
I'm not willing to introduce this feature without testing it.
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.
Yes, I just want to see your attitude towards this PR before adding the test. Because I remember you have implemented something similar before.
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.
Ah, then let me review and get back to you.
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.
Checklist
- Increase coverage for the new multiprocess manager to 100% (if tests are slow, run on a separate job in the CI, and only if the
multiprocess.py
is changed). - Docstrings.
- Documentation (I can help here).
- Answer the question: how this should interact with
--reload
? - Move
UvicornWorker
out from Uvicorn's source code (I'll do it).
@abersheeran I'm fully available to move this forward. 👍 |
Ok. 👍 We can move forward with the checklist above 🙏 |
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.
I see what the PR is doing, but I somewhat fail to understand the why and the goals. Is the pinging the ultimate feature add here?
Co-authored-by: Marcelo Trylesinski <[email protected]>
Co-authored-by: Marcelo Trylesinski <[email protected]>
Co-authored-by: Marcelo Trylesinski <[email protected]>
Co-authored-by: Marcelo Trylesinski <[email protected]>
Co-authored-by: Marcelo Trylesinski <[email protected]>
Can you try the latest commit version? This should solve the problem. |
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.
Please use the English version of the documentation instead of chinese version
I think the PID should be shown in the Is it normal for the child processes to be alive after I kill the manager process? |
Here I just reused the previous logger. If we want to refactor the logs, I think it can be done in another PR.
No, normally only killing the manager process through the SIGKILL signal will result in the survival of child processes (this is due to system signal mechanism reasons, and it also exists in all other multi-process managers), under other circumstances, child processes should be killed. |
Thanks @abersheeran 🙏 |
Summary
About #2164.
The multiprocess manager introduced by this PR includes process keep-alive and process hung detection. It also imitates gunicorn and uses hup, ttin, and ttou signals to control child processes.
Checklist