Merge branch '4.11': Fixes #2633 don't block agent for pending tasks on reconnection (#2638)

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-05-16 15:35:37 +05:30
commit 4661daa1dd

View File

@ -495,19 +495,7 @@ public class Agent implements HandlerFactory, IAgentControl {
_resource.disconnected();
final String lastConnectedHost = _shell.getConnectedHost();
int inProgress = 0;
do {
_shell.getBackoffAlgorithm().waitBeforeRetry();
s_logger.info("Lost connection to host: " + lastConnectedHost + ". Dealing with the remaining commands...");
inProgress = _inProgress.get();
if (inProgress > 0) {
s_logger.info("Cannot connect because we still have " + inProgress + " commands in progress.");
}
} while (inProgress > 0);
s_logger.info("Lost connection to host: " + _shell.getConnectedHost() + ". Attempting reconnection while we still have " + _inProgress.get() + " commands in progress.");
_connection.stop();