mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +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);
|
logger.error("Error parsing task", e);
|
||||||
}
|
}
|
||||||
} else if (task.getType() == Task.Type.DISCONNECT) {
|
} 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());
|
reconnect(task.getLink());
|
||||||
} else if (task.getType() == Task.Type.OTHER) {
|
} else if (task.getType() == Task.Type.OTHER) {
|
||||||
processOtherTask(task);
|
processOtherTask(task);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user