[Swift-commit] cog r3777

swift at ci.uchicago.edu swift at ci.uchicago.edu
Thu Sep 5 14:55:03 CDT 2013


------------------------------------------------------------------------
r3777 | hategan | 2013-09-05 14:51:12 -0500 (Thu, 05 Sep 2013) | 1 line

don't keep planning blocks if shutting down
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java	(revision 3776)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java	(working copy)
@@ -79,7 +79,7 @@
 
     private ChannelContext clientChannelContext;
 
-    private boolean done, planning;
+    private boolean done, planning, shuttingDown;
 
     private final Metric metric;
 
@@ -131,7 +131,7 @@
         try {
             script = ScriptManager.writeScript();
             int planTimeMillis = 1;
-            while (!done) {
+            while (!done && !shuttingDown) {
                 if (logger.isDebugEnabled()) {
                     logger.debug("Holding queue job count: " +
                              holding.size());
@@ -149,6 +149,9 @@
                     incoming.wait(Math.min(planTimeMillis * 20, 10000) + 1000);
                 }
             }
+            if (shuttingDown) {
+                logger.info("Service shutting down. Exiting planning loop.");
+            }
         }
         catch (Exception e) {
             CoasterService.error(13, "Exception caught in block processor", e);
@@ -787,6 +790,9 @@
 
     @Override
     public void shutdown() {
+        synchronized(holding) {
+            shuttingDown = true;
+        }
         shutdownBlocks();
         done = true;
     }



More information about the Swift-commit mailing list