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: Prevent SSH idle disconnects via proper keepalive wiring (#175)
Idle SSH sessions were disconnecting inconsistently - sometimes after a
few minutes, sometimes after ~10 minutes. Three underlying issues:
1. russh's default Config::inactivity_timeout is 10 minutes and was
inherited verbatim by to_russh_config(), imposing a hard ceiling on
every session regardless of keepalive liveness. Now set to None when
keepalive is enabled, so the keepalive mechanism alone decides when
a peer is dead.
2. No TCP-level SO_KEEPALIVE was set on the underlying socket, so NAT
and stateful firewall conntrack entries could expire silently
between SSH keepalive packets. connect_with_config now builds the
TcpStream manually, applies socket2::TcpKeepalive derived from the
SSH keepalive config, and hands it to russh::client::connect_stream.
3. The exec-mode path threaded an SshConnectionConfig through the
executor but dropped it at ConnectionConfig (the field was marked
dead_code), so user-configured server_alive_interval never reached
Client::connect_with_ssh_config. The field is now live and flows
through connect_direct / connect_via_jump_hosts / the jump chain.
Adds socket2 as a direct dependency (already transitive via tokio).
0 commit comments