Skip to content

Commit efeda7a

Browse files
itamarometa-codesync[bot]
authored andcommitted
Backport gh-140485: Catch ChildProcessError in multiprocessing resource tracker
Summary: upstream issue: python/cpython#140485 upstream PR: python/cpython#141132 background: python/cpython#88887 was fixed in python/cpython#131530 and included in Python 3.12.10, but this introduced a new issue that was fixed in 3.13+ but was too late to get into the 3.12 branch so cherry-picking the fix into Meta Python 3.12, since we're running into this Reviewed By: parulgupta1004 Differential Revision: D89418469 fbshipit-source-id: a26c1d4836ae4e9859657eb1dccd98d10af855eb
1 parent 5d8e7b9 commit efeda7a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/multiprocessing/resource_tracker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ def _stop_locked(
108108
close(self._fd)
109109
self._fd = None
110110

111-
waitpid(self._pid, 0)
111+
try:
112+
waitpid(self._pid, 0)
113+
except ChildProcessError:
114+
self._pid = None
115+
self._exitcode = None
116+
return
112117
self._pid = None
113118

114119
def getfd(self):

0 commit comments

Comments
 (0)