aio-libs / aiohappyeyeballs

Happy Eyeballs for pre-resolved hosts
Other
11 stars 9 forks source link

fix: rewrite staggered_race to be race safe #101

Closed bdraco closed 1 month ago

bdraco commented 1 month ago

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

https://github.com/aio-libs/aiohttp/issues/8599 - this is what the new implementation from stdlib was intended to solve but it has other regressions

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/aio-libs/aiohappyeyeballs/pull/101/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/aio-libs/aiohappyeyeballs/pull/101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs) | `99.55% <100.00%> (+0.56%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aio-libs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bdraco commented 1 month ago

The downside of this approach is we forced to consume the generator expression into a list, so we end up building partials for code will never run