Add a function to check for killed processes in all strategies (#16684)

* Add a function to check for killed processes so that if any
threads are sigkilled or sigtermed, the entire playbook execution is aborted.
This commit is contained in:
jctanner 2016-07-14 16:37:35 -04:00 committed by GitHub
parent ae0c1bbc47
commit 238c6461f6
3 changed files with 22 additions and 1 deletions

View file

@ -454,9 +454,14 @@ class StrategyBase:
display.debug("waiting for pending results...")
while self._pending_results > 0 and not self._tqm._terminated:
if self._tqm.has_dead_workers():
raise AnsibleError("A worker was found in a dead state")
results = self._process_pending_results(iterator)
ret_results.extend(results)
time.sleep(0.005)
display.debug("no more pending results, returning what we have")
return ret_results