agent: Fixes #2858 agent LB not working (#2859)

This fixes the issue that on reconnection, agent LB feature will fail
and only the first ms-host will be tried reconnection again and again.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-09-22 14:40:18 +05:30 committed by GitHub
parent 70dbfa7883
commit 6f1c5551fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -509,8 +509,8 @@ public class Agent implements HandlerFactory, IAgentControl {
_shell.getBackoffAlgorithm().waitBeforeRetry();
}
final String host = _shell.getNextHost();
do {
final String host = _shell.getNextHost();
_connection = new NioClient("Agent", host, _shell.getPort(), _shell.getWorkers(), this);
s_logger.info("Reconnecting to host:" + host);
try {