Message367543
Thomas Moreau: "One solution would be to use the `self._shutdown_lock` from the executor to protect the call to `close` in `terminate_broken` and the call to `self._thread_wakeup.wakeup` in `shutdown`. That way, the lock is only acquired at critical points without being used all the time. This could also be done by adding `lock=True/False` to only lock the potentially dangerous calls."
I wrote a conservative PR 19760 which always lock ProcessPoolExecutor._shutdown_lock while accessing _ThreadWakeup.
PR 19760 fix test_killed_child(): it doesn't fail anymore, even with my msg367463 patch (add sleep). |
|
Date |
User |
Action |
Args |
2020-04-28 16:43:01 | vstinner | set | recipients:
+ vstinner, pitrou, tomMoral, aeros |
2020-04-28 16:43:01 | vstinner | set | messageid: <1588092181.18.0.134049447708.issue39995@roundup.psfhosted.org> |
2020-04-28 16:43:01 | vstinner | link | issue39995 messages |
2020-04-28 16:43:01 | vstinner | create | |
|