Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/multiprocessing/popen_spawn_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def _launch(self, process_obj):
self._fds.extend([child_r, child_w])
self.pid = util.spawnv_passfds(spawn.get_executable(),
cmd, self._fds)
os.close(child_r)
child_r = None
os.close(child_w)
child_w = None
self.sentinel = parent_r
with open(parent_w, 'wb', closefd=False) as f:
f.write(fp.getbuffer())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix potential hang in ``multiprocessing.popen_spawn_posix`` that can happen
when the child proc dies early by closing the child fds right away.
Loading