-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
socketserver.BaseServer.handle_error() should not catch exiting exceptions #67618
Comments
I propose changing the socket servers to not suppress exceptions that are meant to exit the interpreter. This is most applicable to single threaded servers, but my patch does the same thing for multithreading servers. It no longer catches exceptions that are not derived from the Exception class, such as KeyboardInterrupt and SystemExit. The shutdown_request() method is still called in all cases though. I also added a test for the forking server’s handle_error() method. |
Looking at this again, I think I should make the forking server’s handle_error() method only be called for Exception subclasses as well. So I am posting a new patch that also does this. |
Patch v3:
Let me know what you think. |
Oops I forgot to refresh the patch. Patch v4 also closes the server in the tests. |
Here is an updated version for 3.6. I also wrote an entry for What’s New. It seems my change could help people trying to make a single-threaded server quit the server loop (bpo-13749). |
Thanks for the reivew Berker. I have merged the patch with recent changes and updated according to your comments. |
New changeset d500d1a9615f by Martin Panter in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: