Skip to content
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

fix: close runner up sockets in the event there are multiple winners #143

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Mar 4, 2025

What do these changes do?

The first attempt to fix this was to use the cpython staggered race updates in #142 but there is still a race there where there can be multiple winners. Instead we now accept that we will not be able to cancel all coros in time and there will always be a risk of multiple winners. We store all sockets in a set that were not already cleaned up and we close all but the first winnner after the staggered race finishes.

Are there changes in behavior for the user?

bug fix

Related issue number

related aiohttp issue aio-libs/aiohttp#10506

The first attempt to fix this was to use the cpython staggered
race updates in #142 but there is still a race there where there
can be multiple winners. Instead we now accept that we will not
be able to cancel all coros in time and there will always be
a risk of multiple winners. We store all sockets in a set
that were not already cleaned up and we close all but the
first winnner after the staggered race finishes.
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e96264a) to head (fe2f96c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #143   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          232       246   +14     
  Branches        47        52    +5     
=========================================
+ Hits           232       246   +14     

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

@bdraco bdraco merged commit 476a05b into main Mar 4, 2025
22 of 23 checks passed
@bdraco bdraco deleted the cleanup_sockets branch March 4, 2025 03:17
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