diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-08-21 19:45:19 +0100 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-08-21 19:45:19 +0100 |
commit | 9b0808b4447e52b89e45e83c45fe14b11c916078 (patch) | |
tree | e33b4f30b1d2f38fea243bb8ee54bf2ab19d5efb /Lib/multiprocessing/forkserver.py | |
parent | d1e599e1c9f6aa68e2974fb2746d5bb5b49f35e3 (diff) | |
download | cpython-9b0808b4447e52b89e45e83c45fe14b11c916078.tar.gz |
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/forkserver.py')
-rw-r--r-- | Lib/multiprocessing/forkserver.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py index 628808e53f..26bf0c3a11 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) |