Skip to content

[PR #10656/06db052e backport][3.12] Revert: Close the socket if there's a failure in start_connection() #10464 #10658

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

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Apr 1, 2025

This is a backport of PR #10656 as merged into master (06db052).

Reverts #10464

While this change improved the situation for uvloop users, it caused a regression with SelectorEventLoop (issue #10617)

The alternative fix is MagicStack/uvloop#646 (not merged at the time of this PR)

issue #10617 appears to be very similar to python/cpython@d5aeccf

If someone can come up with a working reproducer for #10617 we can revisit this.
cc @top-oai

Minimal implementation that shows on cancellation the socket is cleaned up without the explicit close #10617 (comment) so this should be unneeded unless I've missed something (very possible with all the moving parts here)

Related issue number

fixes #10617

…10464 (#10656)

Reverts #10464

While this change improved the situation for uvloop users, it caused a
regression with `SelectorEventLoop` (issue #10617)

The alternative fix is MagicStack/uvloop#646
(not merged at the time of this PR)

issue #10617 appears to be very similar to
python/cpython@d5aeccf

If someone can come up with a working reproducer for #10617 we can
revisit this.
cc @top-oai

Minimal implementation that shows on cancellation the socket is cleaned
up without the explicit `close`
#10617 (comment)
so this should be unneeded unless I've missed something (very possible
with all the moving parts here)

## Related issue number

fixes #10617

(cherry picked from commit 06db052)
Copy link

codspeed-hq bot commented Apr 1, 2025

CodSpeed Performance Report

Merging #10658 will not alter performance

Comparing patchback/backports/3.12/06db052eae399de1c7c34c0122d736e06c045ec7/pr-10656 (779f021) with 3.12 (91d3d76)

Summary

✅ 51 untouched benchmarks

@bdraco bdraco enabled auto-merge (squash) April 1, 2025 03:03
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.10%. Comparing base (91d3d76) to head (779f021).
Report is 4 commits behind head on 3.12.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.12   #10658      +/-   ##
==========================================
+ Coverage   97.79%   98.10%   +0.30%     
==========================================
  Files         126      126              
  Lines       37623    37600      -23     
  Branches     2132     2132              
==========================================
+ Hits        36792    36886      +94     
+ Misses        652      545     -107     
+ Partials      179      169      -10     
Flag Coverage Δ
CI-GHA 97.98% <100.00%> (+0.29%) ⬆️
OS-Linux 97.68% <100.00%> (+0.01%) ⬆️
OS-Windows 94.75% <100.00%> (?)
OS-macOS 96.81% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.70% <100.00%> (+0.28%) ⬆️
Py-3.10.16 97.27% <100.00%> (+<0.01%) ⬆️
Py-3.11.11 97.37% <100.00%> (?)
Py-3.11.9 96.81% <100.00%> (+0.28%) ⬆️
Py-3.12.9 97.77% <100.00%> (+1.15%) ⬆️
Py-3.13.2 97.76% <100.00%> (+0.47%) ⬆️
Py-3.9.13 96.59% <100.00%> (+0.28%) ⬆️
Py-3.9.21 97.15% <100.00%> (+0.19%) ⬆️
Py-pypy7.3.16 84.20% <100.00%> (?)
VM-macos 96.81% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 97.68% <100.00%> (+0.01%) ⬆️
VM-windows 94.75% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco closed this Apr 1, 2025
auto-merge was automatically disabled April 1, 2025 03:13

Pull request was closed

@bdraco bdraco reopened this Apr 1, 2025
@bdraco bdraco enabled auto-merge (squash) April 1, 2025 03:13
@bdraco bdraco merged commit 7995831 into 3.12 Apr 1, 2025
58 of 66 checks passed
@bdraco bdraco deleted the patchback/backports/3.12/06db052eae399de1c7c34c0122d736e06c045ec7/pr-10656 branch April 1, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant