mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Fix agent wait before reconnect (#12153)
This commit is contained in:
parent
243f566a60
commit
e4414d1c44
@ -1228,7 +1228,14 @@ public class Agent implements HandlerFactory, IAgentControl, AgentStatusUpdater
|
||||
logger.error("Error parsing task", e);
|
||||
}
|
||||
} else if (task.getType() == Task.Type.DISCONNECT) {
|
||||
logger.debug("Executing disconnect task - {}", () -> getLinkLog(task.getLink()));
|
||||
try {
|
||||
// an issue has been found if reconnect immediately after disconnecting.
|
||||
// wait 5 seconds before reconnecting
|
||||
logger.debug("Wait for 5 secs before reconnecting, disconnect task - {}", () -> getLinkLog(task.getLink()));
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
logger.debug("Executing disconnect task - {} and reconnecting", () -> getLinkLog(task.getLink()));
|
||||
reconnect(task.getLink());
|
||||
} else if (task.getType() == Task.Type.OTHER) {
|
||||
processOtherTask(task);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user