mirror of https://github.com/apache/cloudstack.git
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 commit8ce6eba549) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit59ce63918e)
This commit is contained in:
parent
5b549fd869
commit
54ebbe55a7
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue