From dbbcaf7a355e925911fa77e204dd2c38ee633c0f Mon Sep 17 00:00:00 2001 From: Oswin Nathanial Date: Tue, 13 Oct 2015 11:51:05 +0900 Subject: Run os.kill for all child pids even after some of them are down Right now, we come out of the iteration in case of failure while trying to kill a child pid. This may result in some of the child pids staying alive. Change-Id: I18d58fcefec2bbdae4ae9bf73594939ade241b52 --- git/cmd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index a7435497..af019f13 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -618,7 +618,10 @@ class Git(LazyMixin): try: os.kill(pid, SIGKILL) for child_pid in child_pids: - os.kill(child_pid, SIGKILL) + try: + os.kill(child_pid, SIGKILL) + except OSError: + pass kill_check.set() # tell the main routine that the process was killed except OSError: # It is possible that the process gets completed in the duration after timeout -- cgit v1.2.1