Repository navigation
conference: remove departed participants after a per-room grace; rejoin, silent links, scene removals - #1483
Merged
Merged
Conversation
…grace A participant who left stayed in the room tree for good. The relay only marked it left (presence.joined=0), since a delete did not replicate before #1473. So every client held, and every join snapshot carried, a ghost of everyone who had ever joined. The relay (arisrv) now removes them: - When a connection ends, the participant is marked left at once, as before: the roster, the holon and the area of interest drop it. - Once it has been away --leave-grace-s (default 300) without coming back, room_departures removes its subtree (room_remove): one delete, which every client applies. - One back in time, joined again or holding a connection, is kept. A client that reconnects (it keeps its pid) finds what it published, its streams, avatar and device, still there. - --leave-grace-s 0 removes it as its connection ends. A bridged user leaves with a delete at once (room_bridge_absent). The relay is their only writer, and one who comes back is written anew. room_leave still only marks a participant left: a client's (room-leave) and a document's teardown do that, and the relay removes it once its connection has gone. Docs: the conference roadmap's switch table, reaping note and room-leave row; DISTRIBUTED_STATE_ROADMAP.md's known gaps.
…links, scene removals The first commit removes a departed participant after a grace. This one fills what it left open. - The grace is per room: the server document's server: leave_grace_s: (whole seconds), which --leave-grace-s overrides; 300 when neither says. - A participant marked left that keeps its connection (a document's (room-leave)) is removed after the grace too: room_departures::reap finds it. One whose connection is back after a drop has the whole grace from then to join again, and is removed if it never does. - Back after the grace: room_own_state keeps what a participant published under its node (not the relay's keys, its presence, intent, net readings or drive request), and room_reassert writes it again. arigl takes it before it redials and writes it while it rejoins; a document's (room-join) does it after its own (room-leave). The relay forgets the streams it relayed for a removed participant, so one published again is relayed and marked ready afresh. - Silent connections: state_transport::reap_idle, now on the gRPC transport too (a stream silent past the timeout is cancelled, as a close). arisrv reaps both transports each second after --idle-timeout-s (default 10; 0 = never), and arigl and relay_session close a silent link to the relay, so they dial again. - Scene objects, lights and avatar options the relay drops are removed (a delete each), not marked present = 0. Docs: ARIADNE.md's server: block, the conference roadmap's switches and reaping note, and DISTRIBUTED_STATE_ROADMAP.md's known gaps.
transfix
force-pushed
the
feat/conference-leave-deletes
branch
from
November 24, 2026 02:22
a061e0c to
7c68514
Compare
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
This was referenced Nov 24, 2026
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
… = 0 (#1525) write_room_entities marked an entity the world no longer has present = 0, so the room tree, and every client's copy and join snapshot, kept a subtree for every entity that ever ran. Deletes replicate since #1473, and the room's scene objects, lights and avatar options are removed that way since #1483; entities now are too. - section_writer::remove takes an entry (a leaf or a subtree) out of a revisioned section: one delete, which every peer applies, and whose tombstone keeps a peer that still holds the entry from bringing it back. Never the section itself. - write_room_entities removes each entity the section has that the world does not, before the commit that bumps the revision, so a reader that sees the new revision no longer finds it. Readers still take only entries with present = 1, which a write sets last. Docs: room_entities.h, the conference roadmap's reaping note, ARIADNE_WORLDS.md's scene wire format and old-relay note.
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
…ials again (#1546) reap_idle was a no-op in the browser (wasm) build of the WebSocket transport. A page whose relay, or the path to it, went away without closing kept a link that would never speak again, so arigl never dialed again; native clients and the relay already close such a link (#1483). - In the browser, reap_idle closes and deletes a socket that has received nothing for the timeout (the relay pings every 2 s), so it is no longer a link, and arigl's net_step dials the relay again and re-asserts what it published. A backgrounded tab still answers the relay's Pings from onmessage, so it is not silent. - It also deletes the socket of a link the browser closed (its onclose has fired) and sweeps the dead connections, which piled up over reconnects. - arigl_web_smoke.mjs: a case with a fake relay on the test server (/apps/silent-relay) that sends one empty frame and then nothing. The page must log the close and dial a second time. Against arigl-web 4.0.9, without this change, the case fails (one open, no close) and the other 25 pass. - ci.yml: the arigl-web job also runs when the WebSocket transport changes. - The smoke case runs only on a package with the WebSocket transport (the browser's WebSocket API in the module's glue, as cyprty's stage.sh checks): ariglx-web is built without it, so its page never dials a relay, and the harness says when it skips the case.
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.
Builds on #1473 (deletes replicate), merged as 5949edc; rebased onto master.
A participant who left stayed in the room tree for good. The relay only marked it left (
presence.joined=0), since a delete did not replicate before #1473. So every client held, and every join snapshot carried, a ghost of everyone who had ever joined. The conference roadmap's S7 notes called this out ("a join still grows with the soft-left ghosts' subtrees").Two commits: the removal after a grace, then the gaps it left (a client back after the grace, a document that leaves but stays connected, silent connections, scene objects).
What changes
The relay removes departed participants (
arisrv,room_departures,room_remove)(room-leave), which closes nothing) is removed after the grace too.The grace is per room
server: leave_grace_s:(whole seconds), whicharisrv --leave-grace-soverrides; 300 when neither says. 0 removes a participant as its connection ends.Back after the grace (
room_own_state,room_reassert)(room-join)does the same after its own(room-leave).readyagain. Before, the relayed set was never cleared, so it would never be marked ready.Silent connections (
state_transport::reap_idle)--idle-timeout-s(default 10; 0 = never). Every link is probed each 2 s, so a live client is never that silent.relay_sessionclose a silent link to the relay too, so they dial again rather than wait for TCP to give up.Scene objects, lights and avatar options the relay drops are removed from the tree (a delete each), not marked
present = 0(room_scene,room_avatar).Bridged users leave with a delete at once (
room_bridge_absent): the relay is their only writer, and one who comes back is written anew.Why a grace, not a delete at once
arigl and
relay_sessionreconnect under the same pid. If the relay deleted at once, a client back from a dropped link would have to write everything again, and the repeat of missed deletes on admit (#1473) would take it from the client's own tree too. With the grace, anyone back within 5 minutes is unaffected, and the room tree holds ghosts only of those who left in the last 5 minutes.Not done
room_entities) still leave softly (present = 0): OW5j: the boat a client drives, predicted on the relay's water #1469 (OW5j) edits the lines beside it.reap_idleis a no-op under wasm); the relay still reaps the tab's end.Tests
room_intrinsics_test:RemoveTakesTheParticipantFromEveryNode: a relay-side remove is one delete, and it reaches the participant's own node, including what it published; a later join writes it anew.RoomDepartures.OneAwayTheGraceIsRemoved,OneBackInTimeIsKept(joined again; connected again, with a new wait),OneThatLeftButStaysConnectedIsRemoved.ARejoinWritesAgainWhatItPublished: two nodes; what is kept and what is left out, the relay's removal reaching the client, the rewrite reaching the relay, a newer write left alone.RoomBridge.PresenceListsThemApartAndLeavingRemoves.room_avatar_test:ARejoinAfterALeaveBringsTheChoiceBack(the verbs), and a dropped catalog option leaves the tree.room_scene_test: a removed object, and one a new world drops, leave the tree.state_transport_grpc_test:ReapIdleClosesASilentStreamAtEitherEnd,AQuietClientAnsweringPingsIsNotReaped.ariadne_server_document_test:LeaveGraceTakesWholeSeconds.main.cppcompiled against this branch (WebSocket build); it is not run.ari test --relayclient:--leave-grace-s 2: "participant left", then "removed" 2.0 s later.--docwithserver: leave_grace_s: 2and no flag: removed 2.8 s later.--idle-timeout-s 4, the client frozen (a debugger attached, so its socket stays open): "[grpc] reaping idle connection ... idle=4.6s", "participant left", then "removed".