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.gather() records its creator instead of the actual awaiting task in the call graph #162061
* Task(name='child', id=0x1056cc7d0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/Lib/asyncio/locks.py', line 210, in async Event.wait()
+ Awaited by:
* Task(name='Task-1', id=0x1056cc5f0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/repro.py', line 15, in async main()
The problem here that child is not awaited by the main, it's awaited by the gather which in his order is awaited by consumer. At the moment of the capturing call graph, no one of the tasks or futures is not awaited by main
Expected:
* Task(name='child', id=0x101b1c7d0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/Lib/asyncio/locks.py', line 210, in async Event.wait()
+ Awaited by:
* Future(id=0x1017b28d0)
+ Awaited by:
* Task(name='consumer', id=0x101b003f0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/repro.py', line 5, in async consume()
Proposed fix: link children to the future returned by gather() instead of the task that created it
Problem: fix can be applied, but tests for the remote_debugging will fail, i already created #161508 for supportig Futures here, since it will be merged to main i'll be able to work on this issue
Activity
Abhi210 commentedon Nov 16, 2026
I will work on this.
deadlovelll commentedon Nov 16, 2026
Hi! In the body of issue i wrote, since the blocker will disappear, i will work on this issue =)