This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bjs
Recipients asvetlov, bjs, graingert, yselivanov
Date 2021-08-20.14:26:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629469608.0.0.438978243615.issue44962@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-08-20 14:26:48bjssetrecipients: + bjs, asvetlov, yselivanov, graingert
2021-08-20 14:26:48bjssetmessageid: <1629469608.0.0.438978243615.issue44962@roundup.psfhosted.org>
2021-08-20 14:26:47bjslinkissue44962 messages
2021-08-20 14:26:47bjscreate