Repository navigation
Replies: 1 comment
|
Adding packet-level evidence from a case that matches #6092 exactly, with the trigger narrowed to switching into a session that has a deep transcript. Setup. The link is slow but clean, which is why it read as a mystery for a while: ~340 ms average RTT to the internet, 0% ICMP loss over 513 packets, and 0 TCP retransmits / 0 retransmit timeouts on the client. The tailnet path stayed direct with no endpoint change throughout. Capture.
Every socket that died exceeded the ~4–6 s deadline; the survivor never went past 4.4 s. The close is server-initiated, and the client was alive the whole time: Between its last pong and the FIN the client kept sending bare TCP ACKs ( Traffic shape: ~3.4 MB in the 20 s before kill A, ~2.8 MB before B, ~2.3 MB before C. The user's own description is "loading the transcript takes ~30 s, then the dropouts happen immediately after, usually several." Workaround. This is a workaround, not a fix. Consistent with the suggestion in #6092, the durable fix looks like: do not judge the peer dead while its carrier still has |
Uh oh!
There was an error while loading. Please reload this page.
Summary
The gateway's WebSocket heartbeat default (
websocketHeartbeatIntervalMs, default 2000 ms) combined with a fixed 2-missed-ping termination kills any client that goes silent for ~6 s. This kills mobile clients connected through dsh-relay: Android freezes backgrounded apps, so the phone's mux socket stays open at the TCP level while the app stops answering pongs — and the gateway terminates its$eventsstream seconds after the app is backgrounded.Reproduction
0.1.2-rc.1withdsh-relay0.2.1 in front (relay binds:3443, proxies to the loopback gateway)./api/remote.muxupgrade and the$eventsstream open succeed (relay log:OPEN→WS-READY clientId=...).CLOSED upstream-side after Nmswith N ≈ 6–11 s under the default interval.Impact
The phone app cannot hold its event stream while backgrounded — which is exactly when it needs it (to be notified when a turn completes). Completion notifications on mobile are unusable without a config workaround.
Workaround (verified)
Set
websocketHeartbeatIntervalMs: 60000on thetypert-gatewaycomposition row. At a 60 s interval the same phone held its mux for 3+ hours; only truly frozen sockets were reaped (observed159537 ms/170215 mskills, matching 60 s × 2-miss + sweep alignment).Suggestion
Make the termination deadline an absolute silence time (e.g. terminate only after ≥ 120 s of no pong) instead of a fixed 2-missed-ping count at whatever interval is configured — a 2 s interval with 2 misses is far too aggressive for networked/mobile clients, while a 120 s absolute deadline still reaps genuinely dead sockets promptly. Alternatively (or additionally), raise the default interval for remote/mux streams to 30 s.
Happy to test a patch if that's useful.
All reactions