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 [3.14] gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085) (#134447) 2025-05-21 17:36:32 +00:00
context.py [3.14] gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) (#134619) 2025-05-24 04:16:02 +00:00
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 gh-115942: Add locked to several multiprocessing locks (#115944) 2025-04-08 11:14:12 +03:00
pool.py
popen_fork.py gh-131913: multiprocessing: add interrupt for POSIX (GH-132453) 2025-04-22 23:55:24 -07:00
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 gh-118293: Suppress mouse cursor feedback when launching Windows processes with multiprocessing (GH-118315) 2024-04-28 21:10:44 +00:00
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 gh-71052: Enable test_concurrent_futures on platforms that lack multiprocessing (gh-115917) 2024-02-25 11:38:18 -08:00
reduction.py gh-97514: Authenticate the forkserver control socket. (GH-99309) 2024-11-20 08:18:58 -08:00
resource_sharer.py gh-101225: Increase the socket backlog when creating a multiprocessing.connection.Listener (#113567) 2024-01-13 10:48:33 +01:00
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 gh-121288: Make error message for index() methods consistent (GH-121395) 2024-07-05 10:50:45 -07:00
sharedctypes.py
spawn.py
synchronize.py gh-132561: Fix the public multiprocessing.SemLock.locked method (#132586) 2025-04-17 11:41:30 +02:00
util.py [3.14] gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085) (#134447) 2025-05-21 17:36:32 +00:00