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 asvetlov
Recipients Nick Davies, asvetlov, sdunster, thatch, yselivanov
Date 2019-04-17.18:25:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555525501.01.0.104040864788.issue36607@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the report!

I see 3 ways to fix the bug:
1. Guard _all_tasks with threading.Lock. It hurts performance significantly.
2. Retry list(_all_tasks) call in a loop if RuntimeError was raised. A chance of collision is very low, the strategy is good enough
3. Change _all_tasks from weak set of tasks to WeakDict[AbstractEventLoop, WeakSet[Task]]. This realization eliminates the collision it is a little complicated. Plus loop should be hashable now (perhaps ok but I'm not sure if all third-party loops support it).

Thus I'm inclining to bullet 2.
THoughts?
History
Date User Action Args
2019-04-17 18:25:01asvetlovsetrecipients: + asvetlov, thatch, yselivanov, sdunster, Nick Davies
2019-04-17 18:25:01asvetlovsetmessageid: <1555525501.01.0.104040864788.issue36607@roundup.psfhosted.org>
2019-04-17 18:25:00asvetlovlinkissue36607 messages
2019-04-17 18:25:00asvetlovcreate