[Swift-commit] r8234 - branches/release-0.95/src/org/griphyn/vdl/karajan

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Mon Sep 8 13:54:41 CDT 2014


Author: hategan
Date: 2014-09-08 13:54:40 -0500 (Mon, 08 Sep 2014)
New Revision: 8234

Modified:
   branches/release-0.95/src/org/griphyn/vdl/karajan/HangChecker.java
   branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java
Log:
shut down hang checker at the end of run to prevent triggering it during shutdown

Modified: branches/release-0.95/src/org/griphyn/vdl/karajan/HangChecker.java
===================================================================
--- branches/release-0.95/src/org/griphyn/vdl/karajan/HangChecker.java	2014-08-28 14:37:41 UTC (rev 8233)
+++ branches/release-0.95/src/org/griphyn/vdl/karajan/HangChecker.java	2014-09-08 18:54:40 UTC (rev 8234)
@@ -69,6 +69,15 @@
         timer = new Timer("Hang checker");
         timer.scheduleAtFixedRate(this, CHECK_INTERVAL, CHECK_INTERVAL);
     }
+    
+    public void stop() {
+    	try {
+    		timer.cancel();
+    	}
+    	catch (Exception e) {
+    		logger.info("Failed to stop hang checker", e);
+    	}
+    }
 
     public void run() {
         try {

Modified: branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java
===================================================================
--- branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java	2014-08-28 14:37:41 UTC (rev 8233)
+++ branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java	2014-09-08 18:54:40 UTC (rev 8234)
@@ -104,6 +104,7 @@
         boolean runerror = false;
         
         String runID = makeRunId(ap);
+        HangChecker hangChecker = null;
         
         try {
             String project = ap.getStringValue(ArgumentParser.DEFAULT);
@@ -172,7 +173,8 @@
             }
           
             logger.info("RUN_START");
-            new HangChecker(context).start();
+            hangChecker = new HangChecker(context);
+            hangChecker.start();
             
             long start = System.currentTimeMillis();
             ec.start(context);
@@ -193,6 +195,9 @@
         else {
             logger.info("Swift finished with no errors");
         }
+        if (hangChecker != null) {
+        	hangChecker.stop();
+        }
         if (ma != null) {
             ma.close();
         }




More information about the Swift-commit mailing list