Repository navigation
Finalize remote Huddles only on explicit leave; treat archived as terminal - #9384
Merged
brow merged 1 commit intoNov 13, 2026
Merged
Conversation
…minal A control stream that ends with peers still registered means the ingress relay restarted, crashed or lost its mesh link, and its clients are told to rejoin. Archiving there refused the rejoin. Only an UnregisterPeer frame now finalizes the room; loop-exit teardown releases the room and lease without ending the Huddle, as main did. The ingress also sends its clean close when a SessionEnded teardown wins the reader's select, so a real leave still unregisters. archive_channel_if returns Ok(false) when the locked row is already archived (the mobile end flow archives first), so the finalizer releases the empty room and its lease instead of retaining them with no retry. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tom Brow <[email protected]>
Collaborator
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
klopez4212
approved these changes
Nov 12, 2026
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.
Stacked on #9376 remote Huddle cleanup. It fixes two blocking findings from review of 04321aa.
Summary
Only an explicit leave ends a remote Huddle. On 04321aa, when a control stream ended with peers still registered, the owner archived the channel and published the ended event (48103). That happens when the ingress relay restarts (Huddle audio sockets aren't drained, so they never send
UnregisterPeer), crashes, or loses its relay-to-relay link. The ingress tells its clients to rejoin, but the rejoin then finds the channel archived. Now only anUnregisterPeerframe finalizes the room. Loop-exit teardown goes back to main's behavior: it removes the room and releases the lease, without ending the Huddle. On the ingress, aSessionEndedteardown (the local client's control sink closed while a roster update was queued) now sends the clean close first, so a real leave that loses the reader's select race still unregisters.An already-archived channel is a terminal outcome. The mobile end flow archives the channel itself, often before the last remote connection closes.
archive_channel_ifreturned "channel is already archived" as an error, so the finalizer kept the empty room and its renewing lease with no retry. It now returnsOk(false)when the locked row is already archived. The finalizer then releases local resources and publishes no second ended event. This also fixes main's equivalent leak on the local path.Out of scope, per review: retrying after a failed archive, the Redis validation inside the archive transaction, and the draining-owner behavior change.
Related issue
N/A. Review findings on #9376 remote Huddle cleanup.
Testing
remote_last_leave_ends_huddle_and_releases_owner_resources(new Postgres journey, runs in the postgres-ci lane with Redis): the owner's local participant leaves, then the last remote participant leaves cleanly through the productionHuddleControlAcceptorand finalizer. The unarchived row ends the Huddle once. The creator-archived row publishes no relay ending. Both rows release the room and lease.remote_only_stream_close_releases_owner_room_and_leasenow covers both a bare stream drop (room and lease released, no ending) and a clean leave (exactly one ending).conditional_archive_rechecks_authority_before_committingasserts that archiving an already-archived channel returnsOk(false).🤖 Generated with Claude Code