-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-36668: FIX reuse semaphore tracker for child processes #5172
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
Conversation
20a6b06
to
0a576a3
Compare
0a576a3
to
d9b23e1
Compare
Co-Authored-By: tomMoral <[email protected]>
@pitrou This PR avoid spawning |
@pitrou I think this PR is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me. Just a single comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me
@tomMoral Can you force-push to trigger an AppVeyor build? |
Done |
@pitrou: Please replace |
Thanks @tomMoral . I don't think this needs to be backported to 3.7, do you concur? |
@pitrou yes I agree this is not critical so it is not necessary to backport to 3.7. |
The current implementation of the
semaphore_tracker
creates a new process for each children.This PR intends to fix this behavior.
The easy fix would be to pass the
_pid
to the children but the current mechanism to check if thesemaphore_tracker
is alive relies onwaitpid
which cannot be used in child processes (thesemaphore_tracker
is only a sibling of these processes). The main issue is to have a reliable check that either:waitpid
, I don't see an efficient mechanism.I took the approach of adding a
PROBE
command in the semaphore tracker. When the pipe is closed, the send command fails and this means the semaphore tracker is down.https://bugs.python.org/issue36668