Message396684
MultiLoopChildWatcher still has a race condition. I see different options:
* Deprecate/Remove MultiLoopChildWatcher
* Find a magic fix for MultiLoopChildWatcher. It sounds complicated since it's *designed* to not be related to any event loop. See my failed attempt: PR 26536.
* Document the limitation and adapt the unit test to work around the issue.
If an event loop frequently gets events, the worst case is that a child process complete will be notified later, but at least the event is handled. If the event loop is idle, the completion is never notified.
A workaround is to schedule an asynchronous task which runs frequently, like once per minute. It doesn't even have to do anything. It can be a no-op task.
I'm not really excited by documenting the limitation and suggest a hack to work around the limitation. MultiLoopChildWatcher could belong to a PyPI module.
But for the base asyncio from the stdlib, I would prefer to not ship any known race conditions :-( So I'm more in favor of deprecate/remove. |
|
Date |
User |
Action |
Args |
2021-06-29 00:14:42 | vstinner | set | recipients:
+ vstinner, njs, asvetlov, chris.jerdonek, yselivanov, jstasiak, pablogsal, miss-islington, aeros, kj, shreyanavigyan |
2021-06-29 00:14:42 | vstinner | set | messageid: <1624925682.32.0.570876607689.issue38323@roundup.psfhosted.org> |
2021-06-29 00:14:42 | vstinner | link | issue38323 messages |
2021-06-29 00:14:42 | vstinner | create | |
|