ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1530221 - /ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
Date Tue, 08 Oct 2013 10:57:48 GMT
Author: marrs
Date: Tue Oct  8 10:57:47 2013
New Revision: 1530221

URL: http://svn.apache.org/r1530221
Log:
ACE-415 Improved exception handling of individual steps.

Modified:
    ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java

Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java?rev=1530221&r1=1530220&r2=1530221&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java (original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Tue
Oct  8 10:57:47 2013
@@ -18,13 +18,13 @@
  */
 package org.apache.ace.agent.impl;
 
-import static org.apache.ace.agent.AgentConstants.EVENT_AGENT_CONFIG_CHANGED;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_DISABLED;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_FIXPACKAGES;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_RETRIES;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_STREAMING;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_SYNCDELAY;
 import static org.apache.ace.agent.AgentConstants.CONFIG_CONTROLLER_SYNCINTERVAL;
+import static org.apache.ace.agent.AgentConstants.EVENT_AGENT_CONFIG_CHANGED;
 import static org.apache.ace.agent.impl.ConnectionUtil.closeSilently;
 import static org.apache.ace.agent.impl.InternalConstants.AGENT_INSTALLATION_COMPLETE;
 import static org.apache.ace.agent.impl.InternalConstants.AGENT_INSTALLATION_START;
@@ -484,19 +484,26 @@ public class DefaultController extends C
         boolean disabled = m_disabled.get();
         long interval = m_interval.get();
 
+        if (disabled) {
+        	logDebug("Controller disabled by configuration. Skipping...");
+        	return;
+        }
+        logDebug("Controller syncing...");
         try {
-            if (disabled) {
-                logDebug("Controller disabled by configuration. Skipping...");
-                return;
-            }
-
-            logDebug("Controller syncing...");
-
-            runFeedback();
-            runAgentUpdate();
-            runDeploymentUpdate();
-
-            logDebug("Sync completed. Rescheduled in %d seconds", interval);
+        	runFeedback();
+        	try {
+        		runAgentUpdate();
+        	}
+        	catch (IOException e) {
+                logError("Agent update aborted due to Exception.", e);
+        	}
+        	try {
+        		runDeploymentUpdate();
+        	}
+        	catch (IOException e) {
+                logError("Deployment update aborted due to Exception.", e);
+        	}
+        	logDebug("Sync completed. Rescheduled in %d seconds", interval);
         }
         catch (RetryAfterException e) {
             // any method may throw this causing the sync to abort. The server is busy so
no sense in trying
@@ -504,11 +511,6 @@ public class DefaultController extends C
             interval = e.getBackoffTime();
             logWarning("Sync received retry exception from server. Rescheduled in %d seconds",
e.getBackoffTime());
         }
-        catch (Exception e) {
-            // serious problem throw by a method that decides this is cause enough to abort
the sync. Not much
-            // we can do but log it as an error and reschedule as usual.
-            logError("Sync aborted due to Exception.", e);
-        }
         finally {
             scheduleRun(interval);
         }



Mime
View raw message