Message399973
I can reproduce on 3.9.6
A little digging and it seems asyncio imports Task from _asyncio
and _asyncio's implementation (in asynciomodule.c) of Task has an __init__ which adds the task to the `all_tasks` weakref.WeakSet
which appears to be implemented in Python (in Lib/_weakrefset.py)
weakref.WeakSet is not thread-safe, which means concurrent create_task's in different threads (even on separate event loops) is not safe. |
|
Date |
User |
Action |
Args |
2021-08-20 14:26:48 | bjs | set | recipients:
+ bjs, asvetlov, yselivanov, graingert |
2021-08-20 14:26:48 | bjs | set | messageid: <1629469608.0.0.438978243615.issue44962@roundup.psfhosted.org> |
2021-08-20 14:26:47 | bjs | link | issue44962 messages |
2021-08-20 14:26:47 | bjs | create | |
|