Use a file-like obj for stdout/stderr for deadlock workaround (#74156)
Fixes #74149
This commit is contained in:
parent
d1842afd59
commit
96f94c0fef
2 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue