Skip to content

Commit 52247c5

Browse files
agent: reconnect after waiting 5 seconds (#9258)
* 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>
1 parent f7f7013 commit 52247c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,12 @@ public void doTask(final Task task) throws TaskExecutionException {
11411141
s_logger.error("Error parsing task", e);
11421142
}
11431143
} else if (task.getType() == Task.Type.DISCONNECT) {
1144+
try {
1145+
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
1146+
// wait 5 seconds before reconnecting
1147+
Thread.sleep(5000);
1148+
} catch (InterruptedException e) {
1149+
}
11441150
reconnect(task.getLink());
11451151
return;
11461152
} else if (task.getType() == Task.Type.OTHER) {

0 commit comments

Comments
 (0)