[
https://issues.apache.org/jira/browse/CLOUDSTACK-10132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16249205#comment-16249205
]
ASF GitHub Bot commented on CLOUDSTACK-10132:
---------------------------------------------
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_r150465147
##########
File path: agent/src/com/cloud/agent/AgentShell.java
##########
@@ -107,18 +111,48 @@ public String getPod() {
}
@Override
- public String getHost() {
- final String[] hosts = _host.split(",");
+ public String getNextHost() {
+ final String[] hosts = getHosts();
if (_hostCounter >= hosts.length) {
_hostCounter = 0;
}
- final String host = hosts[_hostCounter % hosts.length];
+ connectedHost = hosts[_hostCounter % hosts.length];
_hostCounter++;
- return host;
+ s_logger.info("Connecting to host: " + connectedHost);
Review comment:
This method only returns the next possible host in list, however, this does
not mean we're connected to the host yet. This might cause threading issues,
and in rare cases the connectedHost might not be the connected host. Reconsider
how this could be re-written, perhaps the connectedHost can be updated using
one of the `Task.CONNECT` handlers.
----------------------------------------------------------------
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]
> Multiple Management Servers Support for agents
> ----------------------------------------------
>
> Key: CLOUDSTACK-10132
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10132
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.11.0.0
> Reporter: Nicolas Vazquez
> Assignee: Nicolas Vazquez
>
> Multiple Management Servers Support for agents
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)