Use a file-like obj for stdout/stderr for deadlock workaround (#74156)

Fixes #74149
pull/74166/head
Martin Krizek 5 years ago committed by GitHub
parent d1842afd59
commit 96f94c0fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "WorkerProcess - Python 3.5 fix for workaround for stdout deadlock in multiprocessing shutdown to avoid process hangs. (https://github.com/ansible/ansible/issues/74149)"

@ -145,8 +145,7 @@ class WorkerProcess(multiprocessing_context.Process):
# TODO: Evaluate overhauling ``Display`` to not write directly to stdout
# and evaluate migrating away from the ``fork`` multiprocessing start method.
if sys.version_info[0] >= 3:
sys.stdout = os.devnull
sys.stderr = os.devnull
sys.stdout = sys.stderr = open(os.devnull, 'w')
def _run(self):
'''

Loading…
Cancel
Save