https://github.com/python/cpython/commit/ec836f2ad65ae7c254f8de6bbc26de91c2ed6163
commit: ec836f2ad65ae7c254f8de6bbc26de91c2ed6163
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: gpshead <[email protected]>
date: 2025-11-11T05:24:24Z
summary:

[3.14] gh-140485: Catch ChildProcessError in multiprocessing resource tracker 
(GH-141132) (#141384)

gh-140485: Catch ChildProcessError in multiprocessing resource tracker 
(GH-141132)
(cherry picked from commit 9cb8c52d5e9a83efe4fa3878db06befd9df52f54)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/multiprocessing/resource_tracker.py

diff --git a/Lib/multiprocessing/resource_tracker.py 
b/Lib/multiprocessing/resource_tracker.py
index c53092f6e34b32..38fcaed48fa9fb 100644
--- a/Lib/multiprocessing/resource_tracker.py
+++ b/Lib/multiprocessing/resource_tracker.py
@@ -111,7 +111,12 @@ def _stop_locked(
         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
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to