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/4.4 to 54ebbe5
Date Fri, 21 Nov 2014 13:56:04 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 5b549fd86 -> 54ebbe55a


CLOUDSTACK-7415. Host remains in Alert after vCenter restart.
Management server PingTask should update PingMap entry for an agent only if it is already
present in the Management Server's PingMap.

(cherry picked from commit 8ce6eba549bcd3fa007aaf10a29c3a2fef9ffaaa)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 59ce63918e227f93d64642e881551c25738de3b3)


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

Branch: refs/heads/4.4
Commit: 54ebbe55a7e199048cf683fd13c04d399a0ab5bd
Parents: 5b549fd
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Mon Aug 25 12:59:40 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Fri Nov 21 14:42:17 2014 +0100

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/AgentManagerImpl.java         | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/54ebbe55/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index 2d0be24..9e0dd30 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -168,7 +168,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
     private int _directAgentThreadCap;
 
     protected StateMachine2<Status, Status.Event, Host> _statusStateMachine = Status.getStateMachine();
-    private final Map<Long, Long> _pingMap = new ConcurrentHashMap<Long, Long>(10007);
+    private final ConcurrentHashMap<Long, Long> _pingMap = new ConcurrentHashMap<Long,
Long>(10007);
 
     @Inject
     ResourceManager _resourceMgr;
@@ -1468,7 +1468,10 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
     }
 
     public void pingBy(long agentId) {
-        _pingMap.put(agentId, InaccurateClock.getTimeInSeconds());
+        // Update PingMap with the latest time if agent entry exists in the PingMap
+        if (_pingMap.replace(agentId, InaccurateClock.getTimeInSeconds()) == null) {
+            s_logger.info("PingMap for agent: " + agentId + " will not be updated because
agent is no longer in the PingMap");
+        }
     }
 
     protected class MonitorTask extends ManagedContextRunnable {


Mime
View raw message