-
-
Notifications
You must be signed in to change notification settings - Fork 394
Closed
Description
Right now, I believe that we don't reap child processes until the user calls .wait or .poll. (or, if that never happens, then until the backstop code in subprocess starts trying to reap old processes when a new one is spawned.)
Of course on Windows this is fine because zombies aren't a thing. But maybe we should reap more aggressively on posix? If we were using SIGCHLD like most async libraries do, then we'd be reaping processes as soon as they exit.
E.g. on Linux, maybe the wait logic should be something like:
def _thread_wait(token, process):
process._popen.wait()
token.call_soon_threadsafe(process._waited.set()?
(Note that Popen.wait is thread-safe, so this is legal: https://bugs.python.org/issue21291)
CC: @oremanj
Reactions are currently unavailable