bug 14168: add re-try to mgt server, in case mgt server is down. status 14168: resolved fixed

This commit is contained in:
Edison Su 2012-03-14 10:48:09 -07:00
parent 1b4954d63a
commit 35911856db
1 changed files with 6 additions and 0 deletions

View File

@ -243,7 +243,13 @@ public class Agent implements HandlerFactory, IAgentControl {
s_logger.error("Unable to start the resource: " + _resource.getName());
throw new CloudRuntimeException("Unable to start the resource: " + _resource.getName());
}
_connection.start();
while (!_connection.isStartup()) {
_shell.getBackoffAlgorithm().waitBeforeRetry();
_connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
_connection.start();
}
}
public void stop(final String reason, final String detail) {