]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Nov 2025 05:21:20 +0000 (06:21 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Nov 2025 05:21:20 +0000 (05:21 +0000)
gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH-141132)
(cherry picked from commit 9cb8c52d5e9a83efe4fa3878db06befd9df52f54)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/multiprocessing/resource_tracker.py

index 2249948da98b000ad97122a52b7e57528e16a79b..2ffbe532cdee507929e6dc5b1aefa737ea9936ce 100644 (file)
@@ -115,7 +115,12 @@ class ResourceTracker(object):
         close(self._fd)
         self._fd = None
 
-        _, status = waitpid(self._pid, 0)
+        try:
+            _, status = waitpid(self._pid, 0)
+        except ChildProcessError:
+            self._pid = None
+            self._exitcode = None
+            return
 
         self._pid = None