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
TaskGroup fails to cancel tasks pending creation, if that task starts a failing task #128550
This is happening because as per the following code, we skip scheduling the done callback to the event loop incase the task completes eagerly, I would lean towards fixing this by removing this case and always add the done callback which would be simpler and fix this.
Activity
pythongh-128550: TaskGroup: cancel tasks added to set after aborting
pythongh-128550: TaskGroup: cancel tasks added to set after aborting
kumaraditya303 commentedon Jan 20, 2025
This is happening because as per the following code, we skip scheduling the done callback to the event loop incase the task completes eagerly, I would lean towards fixing this by removing this case and always add the done callback which would be simpler and fix this.
cpython/Lib/asyncio/taskgroups.py
Lines 200 to 207 in a30277a
graingert commentedon Jan 20, 2025
@kumaraditya303 do we want this removed on 3.14, 3.13 and 3.12? or just 3.12?
kumaraditya303 commentedon Jan 20, 2025
Yes, all the branches.
graingert commentedon Jan 20, 2025
ok will get that setup,
pythongh-128550: remove problematic optimization
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…
graingert commentedon Jan 20, 2025
ok working on news now, looks like it will fix #128588 also
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…
pythongh-128588: pythongh-128550: remove eager tasks optimization tha…