-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should we be more aggressive about reaping child processes? #879
Comments
Interesting idea! I think the main practical benefit would be that if some code using a trio.Process gets cancelled, and the process wasn't wrapped in an Our current reaping behavior mirrors |
The distinction between |
#1315 gives another reason for doing this. |
I think the conclusion here is that we should present the user with the illusion that |
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 insubprocess
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:?
(Note that
Popen.wait
is thread-safe, so this is legal: https://bugs.python.org/issue21291)CC: @oremanj
The text was updated successfully, but these errors were encountered: