You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cancellation leaks out of asyncio.TaskGroup on 3.12 when using eager tasks #128588
Traceback (most recent call last):
File "/home/graingert/projects/anyio/demo.py", line 29, in <module>
asyncio.run(demo(), loop_factory=loop_factory)
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in runreturn runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in runreturnself._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_completereturn future.result()
^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
I believe it was intentionally not backported because the conditions to trigger it were thought to be a bit complex and it needed a change to how Task.cancel worked (re unsetting must_cancel)
Activity
graingert commentedon Jan 7, 2025
I think related to #116720 but a lot easier to trigger by accident.
kumaraditya303 commentedon Jan 8, 2025
This seems fixed on main. Perhaps we missed backporting a fix for it?
graingert commentedon Jan 8, 2025
I believe it was intentionally not backported because the conditions to trigger it were thought to be a bit complex and it needed a change to how Task.cancel worked (re unsetting must_cancel)
kumaraditya303 commentedon Jan 8, 2025
cc @gvanrossum
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
gh-128588: gh-128550: remove eager tasks optimization that missed and…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
[3.13] gh-128588: gh-128550: remove eager tasks optimization that mis…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
[3.12] gh-128588: fix refcycles in eager task creation and remove eag…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…