-
Notifications
You must be signed in to change notification settings - Fork 256
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
process.spawn: Use multiprocessing.Process for returnproc #1249
process.spawn: Use multiprocessing.Process for returnproc #1249
Conversation
3478c19
to
45a3416
Compare
45a3416
to
d756ce9
Compare
56dfffa
to
d65a1c2
Compare
In order to allow callers to manage the lifecycle of fd_pipes file descriptors, create duplicates for _send_fd_pipes to close when it has finished sending them. This fixes bug 916601 in a nice way, allowing commit 3b1234b to be reverted. Bug: https://bugs.gentoo.org/916601 Signed-off-by: Zac Medico <zmedico@gentoo.org>
This reverts commit 3b1234b, since ForkProcess now solves the problem by creating temporary duplicate file descriptors. Bug: https://bugs.gentoo.org/916601 Signed-off-by: Zac Medico <zmedico@gentoo.org>
fb98250
to
a85b175
Compare
Use multiprocessing.Process for returnproc, so that fork will stop being used when python makes "spawn" the default multiprocessing start method. Continue to use _start_fork when returnproc is not enabled, for backward compatibility. Ultimately, it can be removed at the same time as the returnpid parameter. Bug: https://bugs.gentoo.org/916566 Signed-off-by: Zac Medico <zmedico@gentoo.org>
a85b175
to
305612d
Compare
btw it might be worth us adding a single impl (3.12 maybe) to CI w/ a hack to use spawn |
Yeah, that's a necessity. I suppose we could use an environment variable to trigger import multiprocessing
import sys
import pytest
if __name__ == "__main__":
multiprocessing.set_start_method("spawn", force=True)
sys.exit(pytest.console_main()) Maybe it's easier to use as a one-liner: python -c 'import multiprocessing, sys, pytest; multiprocessing.set_start_method("spawn", force=True); sys.exit(pytest.console_main())' |
Use multiprocessing.Process for returnproc, so that fork will stop being used when python makes "spawn" the default multiprocessing start method.
Continue to use _start_fork when returnproc is not enabled, for backward compatibility. Ultimately, it can be removed at the same time as the returnpid parameter.
Bug: https://bugs.gentoo.org/916566