Skip to content

gh-153133: Fix socket leak in asyncio create_connection#153134

Merged
kumaraditya303 merged 2 commits into
python:mainfrom
deadlovelll:gh-153133-socket-leak
Jul 7, 2026
Merged

gh-153133: Fix socket leak in asyncio create_connection#153134
kumaraditya303 merged 2 commits into
python:mainfrom
deadlovelll:gh-153133-socket-leak

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Close the socket in _create_connection_transport() when the transport is never created, not only on await failure

For more details see gh-153133

Comment thread Lib/asyncio/base_events.py Outdated
@kumaraditya303
kumaraditya303 merged commit 374920a into python:main Jul 7, 2026
55 checks passed
@kumaraditya303 kumaraditya303 added topic-asyncio needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 24, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @deadlovelll for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @deadlovelll for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app

Copy link
Copy Markdown

Sorry, @deadlovelll and @kumaraditya303, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 374920a23d49130f446fe6369220bc548be57cd2 3.14

@bedevere-app

bedevere-app Bot commented Jul 24, 2026

Copy link
Copy Markdown

GH-154631 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 24, 2026
kumaraditya303 pushed a commit that referenced this pull request Jul 25, 2026
…nection (GH-153134) (#154631)

gh-153133: Fix socket leak in error path of asyncio create_connection (GH-153134)
(cherry picked from commit 374920a)

Co-authored-by: Timofei <128279579+deadlovelll@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants