mirror of https://github.com/apache/cloudstack.git
Bug 14551: add top-level catch clause to protect task/thread from stalling
Reviewed-By: Kelven
This commit is contained in:
parent
fa3d5612e0
commit
f7649062a9
|
|
@ -691,16 +691,19 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
|
|||
|
||||
@Override
|
||||
public synchronized void run() {
|
||||
if (!cancelled) {
|
||||
startRebalanceAgents();
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("The agent load balancer task is now being cancelled");
|
||||
}
|
||||
cancelled = true;
|
||||
}
|
||||
try {
|
||||
if (!cancelled) {
|
||||
startRebalanceAgents();
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("The agent load balancer task is now being cancelled");
|
||||
}
|
||||
cancelled = true;
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
s_logger.error("Unexpected exception " + e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void startRebalanceAgents() {
|
||||
s_logger.debug("Management server " + _nodeId + " is asking other peers to rebalance their agents");
|
||||
|
|
|
|||
Loading…
Reference in New Issue