Skip to content

Commit

Permalink
agent: reconnect after waiting 5 seconds (#9258)
Browse files Browse the repository at this point in the history
* agent: reconnect after waiting 5 seconds

* Update agent/src/main/java/com/cloud/agent/Agent.java

* Update agent/src/main/java/com/cloud/agent/Agent.java

Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
  • Loading branch information
weizhouapache and sureshanaparti committed Jun 26, 2024
1 parent f7f7013 commit 52247c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,12 @@ public void doTask(final Task task) throws TaskExecutionException {
s_logger.error("Error parsing task", e);
}
} else if (task.getType() == Task.Type.DISCONNECT) {
try {
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
// wait 5 seconds before reconnecting
Thread.sleep(5000);
} catch (InterruptedException e) {
}
reconnect(task.getLink());
return;
} else if (task.getType() == Task.Type.OTHER) {
Expand Down

0 comments on commit 52247c5

Please sign in to comment.