This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.19 by this push:
new 52247c57bb9 agent: reconnect after waiting 5 seconds (#9258)
52247c57bb9 is described below
commit 52247c57bb94a331185757eb3c203f69b0a75928
Author: Wei Zhou <[email protected]>
AuthorDate: Wed Jun 26 11:03:26 2024 +0200
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 <[email protected]>
---
agent/src/main/java/com/cloud/agent/Agent.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/agent/src/main/java/com/cloud/agent/Agent.java
b/agent/src/main/java/com/cloud/agent/Agent.java
index 9e0ee746c03..e73a26beea1 100644
--- a/agent/src/main/java/com/cloud/agent/Agent.java
+++ b/agent/src/main/java/com/cloud/agent/Agent.java
@@ -1141,6 +1141,12 @@ public class Agent implements HandlerFactory,
IAgentControl, AgentStatusUpdater
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) {