cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/hotfix/4.4/CLOUDSTACK-7184 to d0b39df
Date Wed, 17 Sep 2014 13:08:31 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/4.4/CLOUDSTACK-7184 d04f59a30 -> d0b39df1c


CLOUDSTACK-7184 retry-wait loop config to deal with network glitches

(cherry picked from commit b82f27be4150e70c017ed2597137319daa79560b)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d0b39df1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d0b39df1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d0b39df1

Branch: refs/heads/hotfix/4.4/CLOUDSTACK-7184
Commit: d0b39df1c38d33608628d650734410d8c72837e4
Parents: d04f59a
Author: Daan Hoogland <daan@onecht.net>
Authored: Tue Sep 16 12:20:30 2014 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Wed Sep 17 15:08:09 2014 +0200

----------------------------------------------------------------------
 .../com/cloud/agent/manager/DirectAgentAttache.java    | 13 ++++++++++++-
 .../hypervisor/xen/resource/CitrixResourceBase.java    |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0b39df1/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
index 7ca6929..480a7af 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 
 import com.cloud.agent.api.Answer;
@@ -40,6 +41,10 @@ import com.cloud.resource.ServerResource;
 public class DirectAgentAttache extends AgentAttache {
     private final static Logger s_logger = Logger.getLogger(DirectAgentAttache.class);
 
+    protected final ConfigKey<Integer> _HostPingRetryCount = new ConfigKey<Integer>("Advanced",
Integer.class, "host.ping.retry.count", "2",
+            "Number of times retrying a host ping while waiting for check results", true);
+    protected final ConfigKey<Integer> _HostPingRetryTimer = new ConfigKey<Integer>("Advanced",
Integer.class, "host.ping.retry.timer", "20",
+            "Interval to wait before retrying a host ping while waiting for check results",
true);
     ServerResource _resource;
     List<ScheduledFuture<?>> _futures = new ArrayList<ScheduledFuture<?>>();
     AgentManagerImpl _mgr;
@@ -161,7 +166,13 @@ public class DirectAgentAttache extends AgentAttache {
                 ServerResource resource = _resource;
 
                 if (resource != null) {
-                    PingCommand cmd = resource.getCurrentStatus(_id);
+                    PingCommand cmd = null;
+                    int retried = 0;
+                    while ( cmd == null && ++retried < _HostPingRetryCount.value())
+                    {
+                        cmd = resource.getCurrentStatus(_id);
+                        Thread.sleep(1000*_HostPingRetryTimer.value());
+                    }
                     if (cmd == null) {
                         s_logger.warn("Unable to get current status on " + _id + "(" + _name
+ ")");
                         return;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0b39df1/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 644ef65..a399c98 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -4276,7 +4276,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             if (!pingXAPI()) {
                 Thread.sleep(1000);
                 if (!pingXAPI()) {
-                    s_logger.warn(" can not ping xenserver " + _host.uuid);
+                    s_logger.warn("can not ping xenserver " + _host.uuid);
                     return null;
                 }
             }


Mime
View raw message