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 vstinner
Recipients aeros, asvetlov, chris.jerdonek, jstasiak, kj, miss-islington, njs, pablogsal, shreyanavigyan, vstinner, yselivanov
Date 2021-06-29.00:14:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:42vstinnersetrecipients: + vstinner, njs, asvetlov, chris.jerdonek, yselivanov, jstasiak, pablogsal, miss-islington, aeros, kj, shreyanavigyan
2021-06-29 00:14:42vstinnersetmessageid: <>
2021-06-29 00:14:42vstinnerlinkissue38323 messages
2021-06-29 00:14:42vstinnercreate