mirror of https://github.com/apache/cloudstack.git
set timeout for CheckOnHostCommand to 50 s
This commit is contained in:
parent
c7fb330914
commit
c683fda236
|
|
@ -856,21 +856,13 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||
s_logger.debug("checking if agent (" + hostId + ") is alive");
|
||||
}
|
||||
|
||||
try {
|
||||
Request req = new Request(hostId, _nodeId, new CheckHealthCommand(), true);
|
||||
req.setSequence(agent.getNextSequence());
|
||||
Answer[] answers = agent.send(req, 50 * 1000);
|
||||
if (answers != null && answers[0] != null && answers[0].getResult()) {
|
||||
Status status = Status.Up;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand, reporting that agent is " + status);
|
||||
}
|
||||
return status;
|
||||
Answer answer = easySend(hostId, new CheckHealthCommand(), 50 * 1000);
|
||||
if (answer != null && answer.getResult()) {
|
||||
Status status = Status.Up;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand, reporting that agent is " + status);
|
||||
}
|
||||
} catch (AgentUnavailableException e) {
|
||||
s_logger.debug("Agent is unavailable so we move on. Error: " + e.getMessage());
|
||||
} catch (OperationTimedoutException e) {
|
||||
s_logger.debug("Timed Out " + e.getMessage());
|
||||
return status;
|
||||
}
|
||||
|
||||
return _haMgr.investigate(hostId);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class XenServerInvestigator extends AdapterBase implements Investigator {
|
|||
if (neighbor.getId() == agent.getId() || neighbor.getHypervisorType() != HypervisorType.XenServer) {
|
||||
continue;
|
||||
}
|
||||
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
|
||||
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd, 50 * 1000);
|
||||
if (answer != null && answer.getResult()) {
|
||||
CheckOnHostAnswer ans = (CheckOnHostAnswer)answer;
|
||||
if (!ans.isDetermined()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue