rhtyd commented on a change in pull request #2309: CLOUDSTACK-10132: Multiple
Management Servers Support for agents
URL: https://github.com/apache/cloudstack/pull/2309#discussion_r150463227
##########
File path: agent/src/com/cloud/agent/Agent.java
##########
@@ -990,4 +1091,53 @@ public void doTask(final Task task) throws
TaskExecutionException {
}
}
}
+
+ public class HostLBCheckerTask extends ManagedContextTimerTask {
+
+ @Override
+ protected void runInContext() {
+ try {
+ int index = 0;
+ final String[] msList = _shell.getHosts();
+ String preferredHost = msList[index];
+ final String connectedHost = _shell.getConnectedHost();
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("Running host LB checker task, connected
host=" + connectedHost + ", preferred host=" + preferredHost);
+ }
+ final long wait = _shell.getFailbackPollingWait();
+ while (!preferredHost.equals(connectedHost)) {
+ if (_link != null) {
+ boolean isHostUp = true;
Review comment:
Optional: The code to check if the host is reachable on a port/address can
we refactored.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services