Repository navigation
Relay: don't send a replacement Burrow client-gone for a backlogged Client of the Burrow it replaced - #1887
Open
dormouse-bot wants to merge 1 commit into
Open
Relay: don't send a replacement Burrow client-gone for a backlogged Client of the Burrow it replaced#1887dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
…replaced its own When a Burrow reconnects, RelayHub tells each Client bound to the old socket burrow-gone. If that Client's socket is backlogged, the send tears it down instead, and unregisterClient read the still-set binding and sent client-gone to the replacement, which never bound that clientId. Clear the binding before the send.
Deploying mouseterm with
|
| Latest commit: |
3c449c5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://21dbfde1.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-relay-replacement-backlo.mouseterm.pages.dev |
This branch has not been deployed
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.
When a Burrow reconnects, the self-host Relay could send the replacement Burrow a
client-gonefor a Client it never bound.RelayHub.registerBurrowpoints the map at the new socket, then#dropClientsOftells each Client bound to the old oneburrow-gone. If that Client's socket is pastMAX_RELAY_SOCKET_BUFFERED_BYTES,#toClienttears it down viaunregisterClient, which still saw the old binding (it was only cleared after the send) and looked up#burrows.get(burrowId)— now the replacement. This PR clears the binding before the send.The effect was a stray frame naming a
clientIdthe new Burrow process never saw, which theregisterBurrowdoc comment anddocs/specs/relay.md-> "Routing" ("their bindings are cleared at replacement time") say should not happen. Hosted'sRelayRoomis not affected: itssendnever re-enters teardown.A new case in
relay/test/relay-displaced.test.mjsstalls a bound Client, replaces its Burrow, and asserts the replacement was sent nothing; it fails onmainwith theclient-goneframe and passes here. The fullrelaysuite passes locally.