Commit b6e9ed0
authored
Close failed SSH handshakes to prevent socket buildup (#992)
Investigation:
- Worker heartbeats failed while the host showed heavy TCP retries.
- Checked TCP state counts:
netstat -anp tcp | awk '{print }' | sort | uniq -c | sort -nr | head
- Identified top TIME_WAIT/SYN_SENT destinations:
netstat -anp tcp | awk '=="TIME_WAIT"{print }' | sort | uniq -c | sort -nr | head
netstat -anp tcp | awk '=="SYN_SENT"{print }' | sort | uniq -c | sort -nr | head
- Verified ephemeral port range:
sysctl net.inet.ip.portrange.hifirst net.inet.ip.portrange.hilast
- Checked per-process socket usage:
lsof -nP -iTCP | awk '{print }' | sort | uniq -c | sort -nr | head
Findings:
- Tart isolation retries SSH connections in a tight loop.
- When the TCP dial succeeds but the SSH handshake fails, the net.Conn was left open.
Fix:
- Close net.Conn on handshake failure so each retry releases its socket.1 parent 978c2c6 commit b6e9ed0
File tree
1 file changed
+1
-0
lines changed- internal/executor/instance/persistentworker/remoteagent
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
| |||
0 commit comments