correctly handle term signals

- adhoc now terminates gracefully
- avoid race condition on terminations by ignoring errors if
  worker might have been reaped between checking if active and termination call
- ansible-playbook now properly exits on sigint/term
- adhoc and playbook now give exceptions that we should not normally capture
  and rely on top level finally to reap children
- handle systemexit breaks in workers
- added debug to see at which frame we exit
partial fix for #14346
This commit is contained in:
Brian Coca 2016-02-06 00:53:01 -05:00
parent 45755bc0e5
commit 5a1887cc76
5 changed files with 21 additions and 8 deletions

View file

@ -163,7 +163,7 @@ class ResultProcess(multiprocessing.Process):
except queue.Empty:
pass
except (KeyboardInterrupt, IOError, EOFError):
except (KeyboardInterrupt, SystemExit, IOError, EOFError):
break
except:
# TODO: we should probably send a proper callback here instead of