Skip to content
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

gh-118981: multiprocessing.popen_spawn_posix, fix potential hang #118982

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

albertz
Copy link
Contributor

@albertz albertz commented May 13, 2024

Fix gh-118981.

It can happen that the child crashes right in the beginning for whatever reason. In this case, the parent will hang when writing into the pipe, because the child fd is not closed yet.

The normal pattern is to close the child fds right after the child proc is forked/executed/spawned, so when the child dies, then also the pipes will get close, and there will be no hang (you get SIGPIPE instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multiprocessing.popen_spawn_posix does not close child fds after spawn, can hang
1 participant