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.

Title: Improve FastChildWatcher with WNOWAIT?
Type: Stage:
Components: asyncio Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: WGH, gvanrossum, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-12-23 23:58 by WGH, last changed 2022-04-11 14:58 by admin.

Messages (3)
msg256946 - (view) Author: WGH (WGH) Date: 2015-12-23 23:58
The problem with FastChildWatcher lies in the fact that it can accidentally reap processes that it doesn't watch.

However, os module includes waitid function (since Python 3.3), and it has WNOWAIT flags, which means "return status, let process remain waitable (=don't reap)".

What do you think, can this feature fix the problem with FastChildWatcher?
msg257015 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-12-26 03:11
Hm... Looks like this wouldn't work unless we also implemented the waitid() (note: 'id', not 'pid') syscall, as waitpid() doesn't support this flag (e.g.
msg257016 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-12-26 03:19
Oh, hm, we do seem to have os.waitid() but not on OS X... Well that makes producing a reasonable patch much more complicated. Maybe you want to add a 3rd ChildWatcher just for Linux (or just for platforms that have os.waitid)? (If so, please submit a PR to, which we use as "upstream".)
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70124
2015-12-26 03:19:19gvanrossumsetmessages: + msg257016
2015-12-26 03:11:12gvanrossumsetmessages: + msg257015
2015-12-23 23:58:04WGHcreate