]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Verify running pid before passing it to be killed. 365/head
authorSandon Van Ness <sandon@redhat.com>
Fri, 21 Nov 2014 00:52:05 +0000 (16:52 -0800)
committerSandon Van Ness <sandon@redhat.com>
Fri, 21 Nov 2014 00:52:05 +0000 (16:52 -0800)
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 <sandon@redhat.com>
teuthology/kill.py

index aada4b2e197002c4a94a5c7378f4445ccf37c4c4..e422f86a60491d6a61b7ce364dc85d1d54fe80a6 100755 (executable)
@@ -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: