-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-130850 Refactor _close_self_pipe for conditional socket shutdown in asyncio/selector_events.py #130862
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
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
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.
Per the comments in your other PR, please remove the AI generation from here.
I will |
Similar to pythongh-130862 but for http library
|
Considering this is a non-issue, I'm closing the PR. |
Overview:
Fixes #130850
Conditional Socket Shutdown: The _close_self_pipe function now accepts an optional shutdown parameter. When shutdown=True is passed, the function performs a shutdown of the socket using socket.SHUT_RDWR. If shutdown=False (or if the parameter is omitted), the function proceeds with the original behavior, closing the socket without shutdown.
Error Handling Enhancements: Catches and llogs OSerrors
Testing:
Test with shutdown=True: Simulates a scenario where a graceful shutdown is performed. The server initiates a shutdown, and the client performs a shutdown before closing the socket.
Test with shutdown=False (default): Simulates a standard socket closure without shutdown. Both the server and client close the socket without performing a shutdown.
shutdown()Beforeclose()in_close_self_pipe#130850