From ab042c269b807511856eba09ad368f9a8a3a624a Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 5 Aug 2015 11:44:50 -0400 Subject: [PATCH] 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 --- awx/main/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 453038c8fc..b8449d33f7 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -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: