mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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.
This commit is contained in:
parent
134a868013
commit
8ce6eba549
@ -170,7 +170,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||||||
private int _directAgentThreadCap;
|
private int _directAgentThreadCap;
|
||||||
|
|
||||||
protected StateMachine2<Status, Status.Event, Host> _statusStateMachine = Status.getStateMachine();
|
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
|
@Inject
|
||||||
ResourceManager _resourceMgr;
|
ResourceManager _resourceMgr;
|
||||||
@ -1469,7 +1469,10 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void pingBy(long agentId) {
|
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 {
|
protected class MonitorTask extends ManagedContextRunnable {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user