Skip to content

Conversation

@sharktide
Copy link
Contributor

@sharktide sharktide commented Mar 5, 2025

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.

@bedevere-app
Copy link

bedevere-app bot commented Mar 5, 2025

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 skip news label instead.

Copy link
Member

@ZeroIntensity ZeroIntensity left a 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.

@sharktide
Copy link
Contributor Author

Per the comments in your other PR, please remove the AI generation from here.

I will

@sharktide sharktide requested a review from ZeroIntensity March 6, 2025 13:49
@picnixz
Copy link
Member

picnixz commented May 9, 2025

Considering this is a non-issue, I'm closing the PR.

@picnixz picnixz closed this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio possible Improvement: Using shutdown() Before close() in _close_self_pipe

3 participants