cpython/Lib/multiprocessing
Miss Islington (bot) 3013683e99
[3.14] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (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 8ed5a2b56c)

Co-authored-by: Albert Zeyer <albzey@gmail.com>
2025-10-08 14:22:05 +02:00
..
dummy [3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084) 2025-10-08 00:37:30 +00:00
__init__.py
connection.py
context.py
forkserver.py [3.14] gh-126631: gh-137996: fix pre-loading of __main__ (GH-135295) (#138607) 2025-10-08 00:37:04 +00:00
heap.py
managers.py
pool.py
popen_fork.py
popen_forkserver.py
popen_spawn_posix.py [3.14] gh-118981: multiprocessing.popen_spawn_posix, fix potential hang (gh-118982) (GH-138605) 2025-10-08 14:22:05 +02:00
popen_spawn_win32.py
process.py [3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084) 2025-10-08 00:37:30 +00:00
queues.py
reduction.py
resource_sharer.py
resource_tracker.py [3.14] gh-136839: Refactor simple dict.update calls (GH-136811) (#136840) 2025-07-19 17:36:31 +00:00
shared_memory.py
sharedctypes.py
spawn.py
synchronize.py
util.py