mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03:30
Set recursive on child process canceling
Sometimes ansible spawns many subprocesses that can get orphaned and stuck if we only kill the direct descendent child processes
This commit is contained in:
parent
efcff9b5f7
commit
ab042c269b
@ -442,9 +442,9 @@ class BaseTask(Task):
|
||||
else:
|
||||
main_proc = psutil.Process(pid=child.pid)
|
||||
if hasattr(main_proc, "children"):
|
||||
child_procs = main_proc.children(recursive=False)
|
||||
child_procs = main_proc.children(recursive=True)
|
||||
else:
|
||||
child_procs = main_proc.get_children(recursive=False)
|
||||
child_procs = main_proc.get_children(recursive=True)
|
||||
for child_proc in child_procs:
|
||||
os.kill(child_proc.pid, signal.SIGTERM)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user