Repository: cloudstack
Updated Branches:
  refs/heads/4.5 465ae4760 -> 8ad2e309a


CLOUDSTACK-8238 handling of retry ping improved

Fixed on 4.4 and master but not on 4.5, cherry-picked on 4.5 using commit
fbafc957dc4e9cdc83aceb2762c0b07296b1a3e6

Signed-off-by: Rohit Yadav <[email protected]>

Conflicts:
        engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java


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

Branch: refs/heads/4.5
Commit: 8ad2e309a440f978e4f4c80f9ed614439b01fd3f
Parents: 465ae47
Author: Daan Hoogland <[email protected]>
Authored: Tue Feb 10 14:34:20 2015 +0100
Committer: Rohit Yadav <[email protected]>
Committed: Mon Feb 16 11:35:41 2015 +0530

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/DirectAgentAttache.java        | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8ad2e309/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 f39bf1d..52dfa9f 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
@@ -164,11 +164,9 @@ public class DirectAgentAttache extends AgentAttache {
                 ServerResource resource = _resource;
 
                 if (resource != null) {
-                    PingCommand cmd = null;
+                    PingCommand cmd = resource.getCurrentStatus(_id);
                     int retried = 0;
-                    cmd = resource.getCurrentStatus(_id);
-                    while (cmd == null && retried++ < 
_HostPingRetryCount.value())
-                    {
+                    while (cmd == null && ++retried <= 
_HostPingRetryCount.value()) {
                         Thread.sleep(1000*_HostPingRetryTimer.value());
                         cmd = resource.getCurrentStatus(_id);
                     }

Reply via email to