-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
Handle SIGBREAK
for Windows
#1909
Conversation
Is this an alternative to #1584 ? |
This pr may be related to #1584 but not an alternative. The reloader should do something else on Windows including send In our application, we use Another problem is that Reference:
|
As mentioned above, The Ctrl + Break signal is supposed to be handled by And #1584 tries fixing the graceful exit in reloader when uvicorn it self is the root process, it seems in this case we can use Ctrl+C signal to achieve this goal (Maybe the internal code is different in multiprocessing?). The solution has been proved to be valid on my Windows 10 laptop. TL;DR: Based on current investigation and discussions in our team @nonebot, To implement a graceful exit:
|
Can you also show me the reference on hypercorn that you mentioned in the description, please? |
By the way, |
Did this caused #1972 ? |
Our team member test the 0.22.0 version but can not repreduce the issue on windows 10. The detailed info is shown in the #1584 (comment) |
On Windows,
subprocess.CTRL_BREAK_EVENT
may be sent to subprocess usingos.kill
orprocess.send_signal
asSIGBREAK
signal. This signal can be catched by subprocess to do a graceful shutdown instead of terminating the subprocess directly.And, this signal is also catched in
hypercorn
.