Repository navigation
Conversation
Two relays that each redirect to the other once a session outlives `delay.initial` bounced a Reload between them indefinitely: every hop looked healthy, so the immediate-redirect damping never applied and the backoff reset after each migration. Returning to an endpoint that already sent us elsewhere in the current run of migrations now goes through the backoff without the healthy reset, so the delay escalates to `max` and `delay.timeout` still applies. One-way moves and GOAWAYs back to the same place (a restart) are unaffected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: HangPlayerEngineer <hangplayerengineer@paperclip.blockcast.net>
This was referenced Oct 20, 2026
Collaborator
|
Thanks @kkroo for tracking down this loop and for the clear write-up! Maintainers can't push to branches on organization-owned forks, so this continues in #6115. Your commit is carried over unchanged, so you stay its author. On top of it, that PR merges (Written by Claude Opus 5.5) |
Collaborator
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.
Problem
Reloaddamps a GOAWAY redirect only when it arrives withindelay.initialof connecting. When two relays each redirect to the other after a session has outlived that delay, every hop looks healthy. The backoff resets after each migration, so the client keeps bouncing between the two relays with no delay and never reports an error. Measured onmainwith mock relays (10 msinitial, 40 ms sessions): 24 dials in 1 s, alternating between the two URLs, anderrorstays undefined.Approach
While migrations are chained,
Reloadremembers which endpoints redirected it somewhere else. If a redirect points back to one of them, that hop goes through#retrywithout the healthy-session reset. The delay therefore escalates up todelay.max, anddelay.timeoutstill ends the sequence, with the errorredirect loop. The redirect itself is still honoured; it is only slowed down.The remembered set is cleared when a session ends without a GOAWAY, or when a new sequence starts (URL change, disable/re-enable, page hide).
Two cases are deliberately left unchanged:
Impact
Alternatives
delaykeeps a single backoff policy.Follow-ups
delay.maxand stays there. Is it worth resetting the chain after a session that lived for some long interval?moq-tokioreconnect loop may have the same shape. Not checked here.Verification
Four tests added to
js/net/src/connection/migrate.test.ts:main.delay.timeout: gives up withredirect loop.initial.Results:
bun test(js/net): 1771 pass, 0 fail.migrate.test.ts: 10/10 on each of 5 runs.tsc --noEmitandbiome check: clean. The one warning is already onmain.🤖 Generated with Claude Code