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

Fixes #74149

(cherry picked from commit 96f94c0fef)
pull/74167/head
Martin Krizek 4 years ago committed by GitHub
parent 275d0acfa1
commit f196914e13
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