Repository navigation
gh-159123: fix ResourceWarning flake in asyncio SSL handshake failure tests - #160209
Merged
kumaraditya303 merged 1 commit intoOct 22, 2026
Merged
kumaraditya303 merged 1 commit into
kumaraditya303 merged 1 commit into
Conversation
…ailure tests test_create_server_ssl_verify_failed, test_create_unix_server_ssl_verify_failed and test_create_server_ssl_match_failed stopped the loop as soon as the client handshake failed and then only called Server.close(), which closes the listening sockets but not the accepted server-side transport. If the TLS alert/EOF from the client reached the server socket in the last loop iteration, the transport's _call_connection_lost callback stayed queued when the loop was closed, leaving the socket open and emitting "unclosed transport <_SelectorSocketTransport closing fd=N>". Run the loop until Server.wait_closed() completes so the server-side transport of the failed handshake is closed before the loop is.
kumaraditya303
requested review from
1st1,
asvetlov and
willingc
as code owners
October 22, 2026 06:20
Contributor
Author
|
!buildbot FreeBSD |
|
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit f14237c 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F160209%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Thanks @kumaraditya303 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-160225 is a backport of this pull request to the 3.15 branch. |
|
GH-160226 is a backport of this pull request to the 3.14 branch. |
Member
|
Oh I forgot that server close is asynchronous and should be awaited. |
Member
|
Thanks for the fix! |
kumaraditya303
added a commit
that referenced
this pull request
Oct 22, 2026
kumaraditya303
added a commit
that referenced
this pull request
Oct 22, 2026
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.
Run the loop until Server.wait_closed() completes so the server-side transport of the failed handshake is closed before the loop.