0: Calling run
0: Running
0: Done
0: Throwing
1: Calling run
1: Running
And then it deadlocks. If you press Ctrl-C it seems to be stuck in Runner._cancel_all_tasks(). Unfortunately Debugpy couldn't even interrupt it at that point.
If you remove stdout=asyncio.subprocess.PIPE then it doesn't deadlock.
The problem seems to be that asyncio.gather is leaking tasks when one throws and then asyncio.run is running Runner._cancel_all_tasks, if you use a TaskGroup this doesn't have an issue:
Activity
graingert commented on Oct 22, 2024
The problem seems to be that asyncio.gather is leaking tasks when one throws and then asyncio.run is running Runner._cancel_all_tasks, if you use a TaskGroup this doesn't have an issue:
This issue is a duplicate of #103847