joule-moq-relay: a fan-out holds up no other track, and each core has its own socket #587
Merged
dcharlot
merged 1 commit from 2026-11-03 00:48:02 -05:00
relay/fanout-shards into main 2026-11-02
joule-moq-relay: a fan-out holds up no other track, and each core has its own socket
All checks were successful
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 3m24s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 9s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 5m44s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 1m24s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (pull_request) Successful in 9s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (pull_request) Successful in 7s
WAI examples / WAI examples · does this change touch them (pull_request) Successful in 9s
wai-fleet service / does this change touch it (pull_request) Successful in 7s
joule-moq-room room service / joule-moq-room · does this change touch it (pull_request) Successful in 6s
WAI Studio / does this change touch it (pull_request) Successful in 6s
joule-moq-web browser client / joule-moq-web · does this change touch it (pull_request) Successful in 6s
wai-app and Create / wai-app · does this change touch it (pull_request) Successful in 6s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (pull_request) Successful in 38s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Successful in 59s
wai-fleet service / service · linux (pull_request) Successful in 2m18s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (pull_request) Successful in 2m58s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (pull_request) Successful in 30s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (pull_request) Successful in 1m44s
WAI examples / WAI examples · portable · linux (pull_request) Successful in 10m15s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 7m20s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 5m37s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 12m3s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 4m11s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (pull_request) Successful in 1m7s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 11m32s
wai-fleet service / service · macos (pull_request) Successful in 57s
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (pull_request) Successful in 13m39s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (pull_request) Successful in 5m54s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 11m14s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 13m7s
A big room's fan-out held the relay's one lock for as long as it took to reach every subscriber, so every other room waited. A track's subscribers are now copy on write: a fan-out takes a snapshot under the lock and delivers outside it, so the time under the lock no longer grows with the audience. With a snapshot, a fan-out could still push to a subscription that has just left, which would put a stream after its cancel or past its PUBLISH_DONE count. So a subscription is marked gone under its own lock, and a fan-out holds that lock across each push: a push comes before the mark, or sees it and isn't made. One UDP socket and one endpoint driver carried every peer's packets. The listener now binds one socket per core on its one port, each its own endpoint. Steering by address, which SO_REUSEPORT does by default, would end a session whenever a viewer's address changed: its packets would reach a socket holding no such connection. So a small kernel filter steers by the first byte of the connection ID, and each socket's endpoint issues IDs that come back to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>