changeset 19:a394029414c6

fix
author pieter.lukasse@wur.nl
date Fri, 23 Jan 2015 17:42:19 +0100
parents dae90b9abf61
children 3abd271b4626
files nist_wrapper.py utils.py
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nist_wrapper.py	Fri Jan 23 17:24:03 2015 +0100
+++ b/nist_wrapper.py	Fri Jan 23 17:42:19 2015 +0100
@@ -142,6 +142,9 @@
         if timeSleeping > (startUpTime + job_size*2):
             # abort with timeout:
             utils.log_message(log_file, "No results after " + str(timeSleeping) + " seconds...")
+            # uggly workaround: 
+            utils.kill_process_by_name("nistms.exe")
+            utils.kill_process_by_name("nistms$.exe")
             raise Exception('Error: timeout waiting for NIST results.')
         
     utils.log_message(log_file, "done...")
--- a/utils.py	Fri Jan 23 17:24:03 2015 +0100
+++ b/utils.py	Fri Jan 23 17:42:19 2015 +0100
@@ -44,6 +44,13 @@
             pid = int(line.split(None, 1)[0])
     return pid
 
+def kill_process_by_name(process_name):
+    pid = -1
+    for line in get_process_list():
+        if process_name in line:
+            pid = int(line.split(None, 1)[0])
+            os.kill(pid, 9)
+    
 
 def get_as_dict(in_tsv):
     '''