You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Fix SSH exec timeout to include connection establishment (#452)
Fixes a bug where SSH exec timeout was not comprehensive - it only
killed the SSH process after timeout but didn't configure SSH itself to
respect the timeout during connection establishment.
## Problem
When SSH connections were hanging during:
- DNS lookup
- TCP handshake
- SSH authentication
- Other connection establishment phases
...commands could take much longer than the specified timeout because
SSH has its own default timeout (often 75+ seconds) that wasn't being
configured.
## Solution
Added three SSH configuration options when a timeout is specified:
1. **`ConnectTimeout`** - Set to the configured timeout value to ensure
SSH respects the timeout during connection establishment
2. **`ServerAliveInterval=5`** - Send keepalive packets every 5 seconds
to detect dead connections
3. **`ServerAliveCountMax=2`** - Consider connection dead after 2 missed
keepalives (10 second detection window)
These options work together to ensure:
- Connection establishment can't hang indefinitely
- Established connections that die are detected quickly
- The overall timeout is respected from the moment the `ssh` command
starts
## Testing
- Added integration test that verifies timeout behavior (sleeps 10s with
1s timeout)
- Verifies command returns `EXIT_CODE_TIMEOUT` (-998) in ~1 second
- All changes pass typecheck and linting
_Generated with `cmux`_
0 commit comments