Repository navigation
fix(client): slow networks no longer bounce a connection between routes - #875
Merged
Merged
Conversation
On a slow or lossy network a tailnet route can answer one quick check and then fail to hold a session. The better-route check switched to it, the session dropped a few minutes later, and the next check switched straight back. A route whose session drops within five minutes of such a switch is now skipped by the check for five minutes, doubling on each repeat up to 30 minutes, and is tried last when reconnecting while it cools down. A switched-to route that held for five minutes clears that history. Once an attempted route fails transiently, routes that did not answer their check no longer get a full attempt each, which made a failed reconnect take up to a minute. The supervisor backs off and checks every route again. They are still tried when the attempted routes were blocked. A relay socket that opened and later closed or stopped responding no longer blames DNS or a firewall, since it reached the server.
Upstream divergenceBoth sides are compared with upstream at the in-order tip
Upstream files that start to differ (1)
Upstream files whose difference changes (6)
|
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a slow, lossy network (train Wi-Fi, then a phone hotspot), a desktop client connected to a styal Link environment kept showing "reconnecting". Client traces showed two problems in the connection supervisor:
Dropped sessions also said "Your DNS or firewall may be blocking styal Link" even though the socket had reached the server.
Change
The route paragraphs in
docs/internals/remote.mdanddocs/user/remote-access.mddescribe the new behavior, and the fork ledger has aslow-network-route-stabilityentry. Upstream has no related work in progress.Validation
New supervisor tests drive the real supervisor and route walk on a test clock:
A new session test checks that a relay socket that opened and then closed reports "disconnected." without the hint.
Three of these four fail without the change. The ten-minute case passes either way: it guards against penalizing a route that worked. The full client-runtime suite (2,147 tests), typecheck, lint, and the ledger check pass.
Not verified: behavior on a real slow network. The diagnosis came from client traces of the original trip, but this change has not been exercised on a throttled link.
Written by an agent (Claude Code, claude-opus-5-5).