mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
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:
parent
ae0c1bbc47
commit
238c6461f6
3 changed files with 22 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue