Skip to content

Commit d45c0d5

Browse files
authored
🤖 fix: mark SSH connections healthy after successful operations (#1086)
_Generated with `mux`_ ## Problem SSH connections entered backoff on failures but never recovered on success, causing frequent errors like: ``` SSH connection to ovh-1 is in backoff for 3s. Last error: SSH connection failed (exit code 255) ``` ## Fix Call `markHealthy()` after successful SSH operations (any exit code ≠ 255). This creates symmetric health tracking so transient failures recover automatically once the connection is working again. ## Changes - Added `markHealthy()` call in `exec()` when SSH exits with code ≠ 255 - Added `markHealthy()` call in `execSSHCommand()` on success
1 parent c798730 commit d45c0d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/node/runtime/SSHRuntime.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ export class SSHRuntime implements Runtime {
228228

229229
// SSH exit code 255 indicates connection failure - report to pool for backoff
230230
// This prevents thundering herd when a previously healthy host goes down
231+
// Any other exit code means the connection worked (command may have failed)
231232
if (exitCode === 255) {
232233
sshConnectionPool.reportFailure(this.config, "SSH connection failed (exit code 255)");
234+
} else {
235+
sshConnectionPool.markHealthy(this.config);
233236
}
234237

235238
resolve(exitCode);
@@ -473,6 +476,8 @@ export class SSHRuntime implements Runtime {
473476
return;
474477
}
475478

479+
// Connection worked - mark healthy to clear any backoff state
480+
sshConnectionPool.markHealthy(this.config);
476481
const output = stdout.trim();
477482
resolve(output);
478483
});

0 commit comments

Comments
 (0)