Commit f51f3d9
committed
🤖 Fix SSH exec timeout to include connection establishment
The timeout in SSHRuntime.exec() was not comprehensive - it only killed
the SSH process after the timeout, but didn't configure SSH itself to
respect the timeout during connection establishment.
This meant that if SSH was hanging during DNS lookup, TCP handshake, or
authentication, the command could take much longer than the specified
timeout.
Changes:
- Add ConnectTimeout SSH option set to the configured timeout value
- Add ServerAliveInterval=5 and ServerAliveCountMax=2 to detect dead
connections quickly (10 second detection window)
- These SSH options ensure the timeout is respected from the moment the
ssh command starts, not just after connection is established
- Add integration test for timeout behavior
The fix ensures:
1. Connection establishment can't hang indefinitely
2. Established connections that die are detected quickly
3. The overall timeout is respected comprehensively1 parent 141f03b commit f51f3d9
2 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
125 | 141 | | |
126 | 142 | | |
127 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
145 | 164 | | |
146 | 165 | | |
147 | 166 | | |
| |||
0 commit comments