From: Sandon Van Ness Date: Fri, 21 Nov 2014 00:52:05 +0000 (-0800) Subject: Verify running pid before passing it to be killed. X-Git-Tag: 1.1.0~1061^2~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F365%2Fhead;p=teuthology.git Verify running pid before passing it to be killed. So we don't kill other processes that have taken jobs pid since job has been no longer running. Signed-off-by: Sandon Van Ness --- diff --git a/teuthology/kill.py b/teuthology/kill.py index aada4b2e1..e422f86a6 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -152,6 +152,12 @@ def kill_processes(run_name, pids=None): else: to_kill = find_pids(run_name) + # Remove processes that don't match run-name from the set + to_check = set(to_kill) + for pid in to_check: + if not process_matches_run(pid, run_name): + to_kill.remove(pid) + if len(to_kill) == 0: log.info("No teuthology processes running") else: