Skip to content

Commit d5a0fe9

Browse files
Copilotzhou9584
andcommitted
Increase WebSocket reconnect retry limit from 5 to 10
Co-authored-by: zhou9584 <26757995+zhou9584@users.noreply.github.com>
1 parent 8585188 commit d5a0fe9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

agent/src/main/java/com/microsoft/hydralab/agent/socket/AgentWebSocketClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ public void onClose(int code, String reason, boolean remote) {
7676
}
7777

7878
// if the connection is closed by server with 1008, wait and retry
79+
// Allow up to 10 reconnect attempts before exiting
7980
if (code == CloseReason.CloseCodes.VIOLATED_POLICY.getCode()) {
8081
violatedReconnectTime++;
81-
if(violatedReconnectTime > 5) {
82+
if(violatedReconnectTime > 10) {
8283
log.error("onClose, code: {}, reason: {}, remote: {}, reconnectTime: {}, {}", code, reason, remote, reconnectTime, violatedReconnectTime);
8384
System.exit(code);
8485
} else {

gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)