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
asyncio.wait leaks completed tasks via the 3.14 await-graph when racing a long-lived Future (missing future_discard_from_awaited_by) #152569
On Python 3.14, asyncio.wait(..., return_when=FIRST_COMPLETED) permanently retains every
completed waiting task when one of the awaited futures is long-lived (never resolves). Each call
registers the waiting task on the long-lived future's await-graph (_asyncio_awaited_by) but never
discards it once the wait returns, so the task is pinned until that future finally resolves — which,
for a "signal" future used as a cancellation/close marker, can mean the lifetime of the process.
This is the same omission already fixed for asyncio.staggered.staggered_race in gh-129195 (add to awaited_by → must discard), but asyncio.wait still has it.
Activity
gh-152569: Fix asyncio.wait leaking tasks via await-graph on long-liv…
[3.14] gh-152569: Fix asyncio.wait leaking tasks via await-graph on l…
[3.15] gh-152569: Fix asyncio.wait leaking tasks via await-graph on l…