-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-118981: multiprocessing.popen_spawn_posix, fix potential hang #118982
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
Conversation
@gpshead ping? Or anyone else? |
🤖 New build scheduled with the buildbot fleet by @gpshead for commit 4c9fd26 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F118982%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
pythongh-118982) fix potential hang. 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 be closed, and there will be no hang (the parent gets SIGPIPE instead). (cherry picked from commit 8ed5a2b) Co-authored-by: Albert Zeyer <[email protected]>
pythongh-118982) fix potential hang. 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 be closed, and there will be no hang (the parent gets SIGPIPE instead). (cherry picked from commit 8ed5a2b) Co-authored-by: Albert Zeyer <[email protected]>
GH-138605 is a backport of this pull request to the 3.14 branch. |
GH-138606 is a backport of this pull request to the 3.13 branch. |
…ng (gh-118982) (#138606) gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) fix potential hang. 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 be closed, and there will be no hang (the parent gets SIGPIPE instead). (cherry picked from commit 8ed5a2b) Co-authored-by: Albert Zeyer <[email protected]>
|
pythongh-118982) fix potential hang. 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 be closed, and there will be no hang (the parent gets SIGPIPE instead).
…ng (gh-118982) (GH-138605) fix potential hang. 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 be closed, and there will be no hang (the parent gets SIGPIPE instead). (cherry picked from commit 8ed5a2b) Co-authored-by: Albert Zeyer <[email protected]>
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).