summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-08-21 18:45:19 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-08-21 18:45:19 (GMT)
commita01fb39877241d4de511dcee291defc77501c8b3 (patch)
tree293ae15c08f46d8b0ae20cc382096998e7372171 /Lib/multiprocessing
parent6acbe2aaa385ada342ac9421333fce083041f06f (diff)
downloadcpython-a01fb39877241d4de511dcee291defc77501c8b3.zip
cpython-a01fb39877241d4de511dcee291defc77501c8b3.tar.gz
cpython-a01fb39877241d4de511dcee291defc77501c8b3.tar.bz2
Issue #18762: Print debug info on failure to create new forkserver process.
Also modify test code to hopefully avoid deadlock on failure.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/forkserver.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py
index 628808e..26bf0c3 100644
--- a/Lib/multiprocessing/forkserver.py
+++ b/Lib/multiprocessing/forkserver.py
@@ -66,6 +66,21 @@ def connect_to_new_process(fds):
try:
reduction.sendfds(client, allfds)
return parent_r, parent_w
+ except OSError:
+ # XXX This is debugging info for Issue #18762
+ import fcntl
+ L = []
+ for fd in allfds:
+ try:
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+ except OSError as e:
+ L.append((fd, e))
+ else:
+ L.append((fd, flags))
+ print('*** connect_to_new_process: %r' % L, file=sys.stderr)
+ os.close(parent_r)
+ os.close(parent_w)
+ raise
except:
os.close(parent_r)
os.close(parent_w)