]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Nov 2025 05:24:24 +0000 (06:24 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Nov 2025 05:24:24 +0000 (05:24 +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 c53092f6e34b322922fee78a036487048bfb652f..38fcaed48fa9fb608cb6be7a95dcb5b45be37de8 100644 (file)
@@ -111,7 +111,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