Repository navigation
Conversation
Keep the SSL shutdown timer running until connection_lost(), and start it when the peer shuts down first, so that a peer which sends EOF but does not read cannot keep a closed transport open indefinitely.
gpshead
marked this pull request as ready for review
October 23, 2026 22:03
gpshead
marked this pull request as draft
October 23, 2026 22:50
Member
Author
|
leave as a draft while working out the windows testing issue |
Write until the app protocol is told to pause writing before closing or letting the peer send EOF, rather than assuming one SOCK_MAX_SIZE write is enough to back up the transport. That was not the case on the Windows proactor event loop, where the connection closed cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSLProtocol._on_shutdown_complete()cancelled the shutdown timer, or had none if the peer sent EOF beforeclose(), and then called the non-abortingclose()of the underlying transport, so a peer that half-closed and stopped reading kept the connection open with no time limit. The timer is now kept (or started) on the success path and cancelled byconnection_lost()as before, so_check_shutdown_timeout()aborts the transport if its write buffer has not drained in time.One behaviour change to be aware of: a peer that half-closes and then needs longer than
ssl_shutdown_timeoutto read the data still queued for it is now cut off withTimeoutError, as a peer that does not half-close already is.Fixes #160520
ANT-2026-81HUBBJ7
ssl_shutdown_timeoutafter the peer sends EOF #160520