mirror of https://github.com/apache/cloudstack.git
CS-16022: If host connection fails due to some DB error, host disconnect does not happen and mgmt_server_id is not removed.
Making sure host disconnect is called.
This commit is contained in:
parent
a1bd6d7eb7
commit
4e29e0d5c3
|
|
@ -1639,7 +1639,16 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||
if (cmds != null) {
|
||||
resource.disconnected();
|
||||
}
|
||||
|
||||
if(host == null){
|
||||
if (cmds != null) {
|
||||
StartupCommand firstCmd = cmds[0];
|
||||
host = findHostByGuid(firstCmd.getGuid());
|
||||
if (host == null) {
|
||||
host = findHostByGuid(firstCmd.getGuidWithoutResource());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (host != null) {
|
||||
/* Change agent status to Alert */
|
||||
_agentMgr.agentStatusTransitTo(host, Status.Event.AgentDisconnected, _nodeId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue