From f05ce565cb0076323e0d8369d316038626df3c1f Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Thu, 20 Nov 2014 16:52:05 -0800 Subject: [PATCH] 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 --- teuthology/kill.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: -- 2.47.3