mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user