Skip to content

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Sep 30, 2024

What do these changes do?

We keep using stdlib asyncio.staggered.staggered_race and we keep having issues with it

While I hate to maintain our own, it seems like we need to do this

Are there changes in behavior for the user?

bugfix

Related issue number

fixes #100
fixes #99
fixes #96
#93 - maybe related, unknown
#97 - this looks like a deeper problem
aio-libs/aiohttp#8599 - this is what the new implementation from stdlib was intended to solve but it has other regressions

@codecov
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b075f25) to head (9fd0030).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #101   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         5    -1     
  Lines          198       227   +29     
  Branches        45        60   +15     
=========================================
+ Hits           198       227   +29     
Flag Coverage Δ
99.55% <100.00%> (+0.56%) ⬆️

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 changed the title feat: rewrite staggered_race to be race safe fix: rewrite staggered_race to be race safe Sep 30, 2024
@bdraco bdraco marked this pull request as ready for review September 30, 2024 19:37
@bdraco bdraco merged commit 9db617a into main Sep 30, 2024
@bdraco bdraco deleted the stag branch September 30, 2024 19:37
bdraco added a commit that referenced this pull request Mar 3, 2025
related aiohttp issue aio-libs/aiohttp#10506

In #101 we replaced the staggered race implementation since the cpython version had races
that were not fixed at the time. cpython has since updated the implementation to fix
additional races. Our current implementation still has problems with cancellation
and cpython has fixed that in python/cpython#128475
and python/cpython#124847

This PR ports the latest cpython implementation
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.

AssertionError only with versions 2.4.1 and 2.4.2 Vendored _staggered.py causes problems on Python 3.10

2 participants