Message340424
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? |
|
Date |
User |
Action |
Args |
2019-04-17 18:25:01 | asvetlov | set | recipients:
+ asvetlov, thatch, yselivanov, sdunster, Nick Davies |
2019-04-17 18:25:01 | asvetlov | set | messageid: <1555525501.01.0.104040864788.issue36607@roundup.psfhosted.org> |
2019-04-17 18:25:00 | asvetlov | link | issue36607 messages |
2019-04-17 18:25:00 | asvetlov | create | |
|