-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Happy Eyeballs crashes with Eager Task Factory #124309
Comments
I'd love to help you, but what I can't understand is why it creates an extra task that triggers the assertion.
Maybe you can start from here, sorry I'm not familiar with this. |
Probably removing that assert is sufficient. |
Removing that assertion won't fix the issue; instead, it could cause new errors elsewhere. the real problem isn't with the assertion anyway. |
This issue is unrelated to Happy Eyeballs, but instead that import asyncio
import random
async def main():
asyncio.get_running_loop().set_task_factory(asyncio.eager_task_factory)
await asyncio.staggered.staggered_race([lambda: asyncio.sleep(0) for _ in range(5)], 0.25)
asyncio.run(main()) Using -O (to disable assertions) is a workaround for all versions, but maybe it's worth revisiting |
Ah, using |
That's right, I was confused when I tried to fix it, I kept thinking that maybe it was supporting |
…ager task factories (#124390) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…port eager task factories (pythonGH-124390) (cherry picked from commit de929f3) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…pport e… (#124574) gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org> (cherry picked from commit de929f3) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Thank you so much @ZeroIntensity! Works perfectly. 🍰 😃 |
…n to support eager task factories (python#124390)" This reverts commit de929f3.
…wnstream (pythonGH-124810) * Revert "pythonGH-124639: add back loop param to staggered_race (pythonGH-124700)" This reverts commit e0a41a5. * Revert "pythongh-124309: Modernize the `staggered_race` implementation to support eager task factories (pythonGH-124390)" This reverts commit de929f3. (cherry picked from commit 133e929) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sorry, we had to revert the fix due to the complexity of it (and also because it was causing some other problems). We'll (hopefully) have the fix for this issue in the next-next 3.12 patch (not tomorrow's, the one after, so 3.12.8). |
…ownstream (GH-124810) (#124817) gh-124309: Revert eager task factory fix to prevent breaking downstream (GH-124810) * Revert "GH-124639: add back loop param to staggered_race (GH-124700)" This reverts commit e0a41a5. * Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (GH-124390)" This reverts commit de929f3. (cherry picked from commit 133e929) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This patch is entirely by Thomas and Peter Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This patch is entirely by Thomas and Peter (cherry picked from commit 979c0df) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This patch is entirely by Thomas and Peter (cherry picked from commit 979c0df) Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
I think this can be closed, it's backported to 3.12 and 3.13 |
Bug report
Bug description:
asyncio's
staggered_race
crashes when an eager task factory is being used:See also: aio-libs/aiohttp#8599
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
staggered_race
implementation to support eager task factories #124390staggered_race
implementation to support eager task factories (GH-124390) #124573staggered_race
implementation to support e… #124574The text was updated successfully, but these errors were encountered: