-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 reloader on OSX py38 and Windows #1827
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1827 +/- ##
==========================================
+ Coverage 92.17% 94.79% +2.62%
==========================================
Files 23 24 +1
Lines 2314 2307 -7
Branches 424 421 -3
==========================================
+ Hits 2133 2187 +54
+ Misses 141 75 -66
- Partials 40 45 +5
Continue to review full report at Codecov.
|
This includes #1555 but due to bigger and potentially breaking changes will need more testing. One known issue is that if the server does not exit, the autoreloader will get stuck waiting until another Ctrl+C, after which it will probably abandon the server process and any worker processes that it may have, because this no longer uses external tools to kill all children. This should be fixed in server code, making it exit and terminate its children in a more reliable manner on SIGTERM (for instance, making non-graceful exit if not completed within a timeout). SIGKILL on the server is not a good idea, especially so in multiple worker mode, where the workers would be left running. I believe that eventually autoreloader should be merged to the main process of multiworker mode but that will require a lot more work. Another consideration is that with workers=1 possibly the main process should run the server and the autoreloader be its child, to allow normal debugging etc. |
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 have tested the PR to make sure it still works on Linux. I have not pulled it to confirm in OSX or Windows yet.
Simplified a bit and this now appears to work on all OS. On Windows we don't get graceful shutdowns though, due to lack of SIGTERM.
Also removes
app.run(..., **kwargs)
that was silently consuming invalid arguments, and forces using keywords for all args but host and port (potentially breaking some apps).