mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CS-16258: Load Test - 1 host stuck in "Rebalancing" state forever. "java.lang.NullPointerException" seen in "Cluster-Worker" thread that was handling this process.
- Using temp to not affect the return value for the method.
This commit is contained in:
parent
61a19eb089
commit
60f130c509
@ -1639,19 +1639,21 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
||||
if (cmds != null) {
|
||||
resource.disconnected();
|
||||
}
|
||||
if(host == null){
|
||||
//In case of some db errors, we may land with the sitaution that host is null. We need to reload host from db and call disconnect on it so that it will be loaded for reconnection next time
|
||||
HostVO tempHost = host;
|
||||
if(tempHost == null){
|
||||
if (cmds != null) {
|
||||
StartupCommand firstCmd = cmds[0];
|
||||
host = findHostByGuid(firstCmd.getGuid());
|
||||
if (host == null) {
|
||||
host = findHostByGuid(firstCmd.getGuidWithoutResource());
|
||||
tempHost = findHostByGuid(firstCmd.getGuid());
|
||||
if (tempHost == null) {
|
||||
tempHost = findHostByGuid(firstCmd.getGuidWithoutResource());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (host != null) {
|
||||
if (tempHost != null) {
|
||||
/* Change agent status to Alert */
|
||||
_agentMgr.agentStatusTransitTo(host, Status.Event.AgentDisconnected, _nodeId);
|
||||
_agentMgr.agentStatusTransitTo(tempHost, Status.Event.AgentDisconnected, _nodeId);
|
||||
/* Don't change resource state here since HostVO is already in database, which means resource state has had an appropriate value*/
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user