You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/11/21 11:51:05 UTC

[3/3] git commit: updated refs/heads/4.3 to 59ce639

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 <ro...@shapeblue.com>


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

Branch: refs/heads/4.3
Commit: 59ce63918e227f93d64642e881551c25738de3b3
Parents: 0aba965
Author: Likitha Shetty <li...@citrix.com>
Authored: Mon Aug 25 12:59:40 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Nov 21 16:20:48 2014 +0530

----------------------------------------------------------------------
 .../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/59ce6391/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 4d925fd..8a5c843 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -162,7 +162,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;
 
@@ -1435,7 +1435,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 {