Files
tty7/crates
l0ng-ai a05b371aee fix(ssh): a link whose peer stops answering is noticed and redialled (#1129)
* fix(ssh): a link whose peer stops answering is noticed and redialled

A connection whose peer went silent with the TCP socket still established
(a stalled path, a host that rebooted under it) was never noticed: nothing
is sent on an idle link, russh waits on a channel confirmation forever, and
the cache kept handing the connection out. The machine read "connected",
the GUI sat on "Reconnecting…" indefinitely, routed CLI calls hung, and
Retry Now dialled nothing new.

- Every connection now gets an SSH keepalive (15s, 3 misses) unless its
  profile sets its own interval or turns it off with 0.
- Channel opens wait at most 20s. A connection that does not answer in time
  is marked dead, so the next open dials a fresh one; what already runs on
  it is left alone. The remote probes' exec requests are bounded too.
- When direct-streamlocal is refused on a connection whose server came from
  the per-connection note, the note is dropped and the server proved again
  (which starts it) before falling back to a per-link stdio server. The note
  outlives a server that exited, or a host that rebooted, while the link
  stayed up.

* fix(ssh): a slow forward target or a failed re-prove no longer costs the link

A direct-tcpip open is answered only once the server's own connect to the
target settles, which for a target that drops SYNs outlasts the 20s open
bound on a healthy link. Marking the connection dead there stopped every
forward on it and sent the next pane to dial and authenticate afresh.
direct-tcpip is unbounded again; the keepalive catches a dead peer.

A re-prove of a stale server note that fails now falls back to the
per-link --stdio server instead of failing the link.
2026-10-08 18:07:55 +08:00
..