From 1530bc90f323c4245d54fc7814f1e12eb951291e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 10:50:57 -0700 Subject: [PATCH 1/6] quest(m1): plan the #5244 follow-ups - handshake-admission-deadline: listen.timeout bounds auth admission on both listeners, replacing ADMIT_TIMEOUT for admission. - uring-ci: PRs touching io_uring code run `just rs uring`. Co-Authored-By: Claude Opus 5.5 --- quest/m1/README.md | 2 ++ quest/m1/handshake-admission-deadline.md | 37 ++++++++++++++++++++++++ quest/m1/uring-ci.md | 23 +++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 quest/m1/handshake-admission-deadline.md create mode 100644 quest/m1/uring-ci.md diff --git a/quest/m1/README.md b/quest/m1/README.md index 7ccbaa6b7de..12a750547bc 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -156,6 +156,7 @@ disabled rung strands WHEP, HLS, and moq-mux export viewers. - [Scope track priority](/quest/m1/track-priority-scope.md) - priority orders one owner's streams, and a shared cluster session is fair across tenants - [BBR ACK cleanup](/quest/m1/bbr-ack-cleanup.md) - packet bookkeeping scales with completed entries instead of scanning the flight on every ACK - [Perf](/quest/m1/perf/README.md) - eliminate measured hot-path costs across moq-uring, kio, and the moq-net model +- [io_uring CI](/quest/m1/uring-ci.md) - PRs touching io_uring code run `just rs uring` on a 6.12+ kernel runner - [Benchmark regressions in CI](/quest/m1/bench-ci.md) - PRs get a non-blocking comparison of the Criterion benches they affect, and a nightly trend on main alerts on regressions - [Backport mergeable bench buckets](/quest/m1/bench-buckets.md) - release receives main's per-interval latency buckets and their tests - [Relay session bench](/quest/m1/bench-relay.md) - the same scenario through moq-relay's own connection handling @@ -173,6 +174,7 @@ disabled rung strands WHEP, HLS, and moq-mux export viewers. - [Route wakes](/quest/m1/route-wakes.md) - a route change wakes only the fronts it can move, so pool churn stops scaling with served paths - [Publish channel count](/quest/m1/publish-audio-channel-count.md) - forcing a channel count on an Audio.Capture stops costing the subscriber gaps of silence - [JS request deadline](/quest/m1/js-request-deadline.md) - each JS request, PUBLISH_NAMESPACE included, has one fatal 10 s timer from create to answer and fails fast without stream credit, so nothing queues or retries +- [Handshake deadline covers admission](/quest/m1/handshake-admission-deadline.md) - `listen.timeout` bounds a connection through auth admission on both listeners, replacing the hardcoded admission timeout - [Rust request credit](/quest/m1/rs-request-credit.md) - a moq-net request fails at once without stream credit instead of waiting - [qmux no-wait opens](/quest/m1/qmux-no-wait.md) - @moq/qmux rejects an over-limit create when waitUntilAvailable is false, like Chrome - [E2EE](/quest/m1/e2ee/README.md) - TypeScript and Rust peers interoperate over encrypted broadcasts no relay can decrypt diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md new file mode 100644 index 00000000000..d911952e6e6 --- /dev/null +++ b/quest/m1/handshake-admission-deadline.md @@ -0,0 +1,37 @@ +# [S] The handshake deadline covers admission + +## Goal + +`listen.timeout` bounds a connection from its first packet through auth +admission, on both the tokio and io_uring listeners. A peer that finishes MoQ +SETUP can no longer hold a connection open past the deadline while auth is +pending, and admission has no separate hardcoded bound. + +## Plan + +Decided 2026-10-13 (from #5244's review, where Codex asked to keep enforcing +the deadline while authorization runs): + +- ✅ One deadline through admission. The handshake deadline that already + bounds transport, SETUP and SETUP OK also races `Auth::admit` in + `rs/moq-relay/src/connection.rs` and `rs/moq-relay/src/uring.rs`. On + expiry the session closes with the MoQ timeout code, as for the other + phases. +- `ADMIT_TIMEOUT` (10 s in `rs/moq-relay/src/auth.rs`) stops bounding + admission; a fixed cap that only throws is not a contract. `listen.timeout + = "0"` then waits forever through admission too, as it documents. + Grant renewal in `auth/refresh.rs` keeps its own bound for now; it runs + after the handshake, so `listen.timeout` does not apply. +- Not chosen: keep `ADMIT_TIMEOUT` as an inner cap; a separate + `auth.timeout` config with `listen.timeout` still ending at SETUP. + +Start after #5244 (io_uring handshake deadline) merges, since it adds the +io_uring deadline this extends. + +Tests on controlled time for both listeners: an admission that never answers +closes at the deadline, one answered just inside it is admitted, and `"0"` +waits. Update `doc/bin/relay/config.md`, which says the deadline covers +"transport through MoQ SETUP", and note the behavior change for slow auth +servers in the relay changelog. + +Public API: none. Config: `listen.timeout` now includes admission. Wire: none. diff --git a/quest/m1/uring-ci.md b/quest/m1/uring-ci.md new file mode 100644 index 00000000000..c01e7bb51c3 --- /dev/null +++ b/quest/m1/uring-ci.md @@ -0,0 +1,23 @@ +# [XS] io_uring tests run on PRs + +## Goal + +A PR touching io_uring code runs `just rs uring` (the io_uring clippy and the +moq-uring and moq-relay nextest runs with the `io-uring` feature), so a +regression there fails the PR instead of the next nightly. + +## Plan + +Today `rs uring` runs only in `.github/workflows/nightly.yml`, kernel-gated to +6.12 and later. #5244 resolved a merge conflict in `rs/moq-relay/src/uring.rs` +that no PR check compiled. + +- Add a PR job path-filtered to `rs/moq-uring/**`, `rs/moq-relay/src/uring*`, + and the shared code they build on, following how other path-filtered PR + workflows in `.github/workflows/` are set up. +- ✅ Decided 2026-10-13: fail loud. The job runs on a runner with a 6.12+ + kernel and errors if the kernel is older, rather than skipping. Not chosen: + compile and lint only on PRs, tests nightly. +- Keep the nightly entry unless the PR job covers every path it does. + +Public API: none. Wire: none. From dd3f1b39023700e85763e5a7f58d02e715313e14 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 10:56:56 -0700 Subject: [PATCH 2/6] quest(m1): cover every admission caller and the auth client's timeout Address review: the other Auth::admit callers and moq_auth::Client's fixed 10 s timeout are listed as gaps to settle at start, with a recommendation that follows the recorded decision. Co-Authored-By: Claude Opus 5.5 --- quest/m1/handshake-admission-deadline.md | 30 ++++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md index d911952e6e6..d565779faaf 100644 --- a/quest/m1/handshake-admission-deadline.md +++ b/quest/m1/handshake-admission-deadline.md @@ -1,4 +1,4 @@ -# [S] The handshake deadline covers admission +# [M] The handshake deadline covers admission ## Goal @@ -28,10 +28,30 @@ the deadline while authorization runs): Start after #5244 (io_uring handshake deadline) merges, since it adds the io_uring deadline this extends. -Tests on controlled time for both listeners: an admission that never answers -closes at the deadline, one answered just inside it is admitted, and `"0"` -waits. Update `doc/bin/relay/config.md`, which says the deadline covers +Gaps found in this plan's review, to settle with the maintainer at start: + +- Dropping the shared cap leaves the other `Auth::admit` callers unbounded: + WebSocket admission before the upgrade (`websocket.rs`), HTTP admission + (`admit_http` in `web.rs`), and the public `Cluster::admit` for gateway + sessions. Recommendation, following the decision above: the web callers + race the web listener's timeout, which is the same `listen.timeout`, and + `Cluster::admit` documents that the embedder owns the deadline. +- `moq_auth::Client` sets a 10 s reqwest timeout on every request + (`rs/moq-auth/src/client.rs`), so an HTTP auth server answering `connect` + after 10 s is still refused. The `connect` request drops that fixed bound + and inherits the caller's deadline; `revalidate` and `end` keep theirs, like + grant renewal. + +Race inside the task that owns the admission, or cancel it, so an expired +deadline does not leave admission work running detached. + +Tests on controlled time for each caller, the embedded decider and an HTTP +auth server: an admission that never answers closes at the deadline, one +answered just inside it (past 10 s for the HTTP server) is admitted, and +`"0"` waits. Update `doc/bin/relay/config.md`, which says the deadline covers "transport through MoQ SETUP", and note the behavior change for slow auth servers in the relay changelog. -Public API: none. Config: `listen.timeout` now includes admission. Wire: none. +Public API: no signature changes; `Cluster::admit` and +`moq_auth::Client::connect` no longer time out on their own. Config: +`listen.timeout` now includes admission. Wire: none. From d5764086f1e45aaa440b5e8cb3c0c65be558810b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 11:01:09 -0700 Subject: [PATCH 3/6] quest(m1): keep in-band AUTH attach bounded Co-Authored-By: Claude Opus 5.5 --- quest/m1/handshake-admission-deadline.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md index d565779faaf..c185e924478 100644 --- a/quest/m1/handshake-admission-deadline.md +++ b/quest/m1/handshake-admission-deadline.md @@ -38,9 +38,10 @@ Gaps found in this plan's review, to settle with the maintainer at start: `Cluster::admit` documents that the embedder owns the deadline. - `moq_auth::Client` sets a 10 s reqwest timeout on every request (`rs/moq-auth/src/client.rs`), so an HTTP auth server answering `connect` - after 10 s is still refused. The `connect` request drops that fixed bound - and inherits the caller's deadline; `revalidate` and `end` keep theirs, like - grant renewal. + after 10 s is still refused. Only `connect` drops that fixed bound and + inherits the caller's deadline. `attach` (in-band AUTH, which shares the + `connect` path), `revalidate` and `end` run after the handshake and keep + theirs, like grant renewal, so a stalled server cannot pile up requests. Race inside the task that owns the admission, or cancel it, so an expired deadline does not leave admission work running detached. @@ -48,7 +49,8 @@ deadline does not leave admission work running detached. Tests on controlled time for each caller, the embedded decider and an HTTP auth server: an admission that never answers closes at the deadline, one answered just inside it (past 10 s for the HTTP server) is admitted, and -`"0"` waits. Update `doc/bin/relay/config.md`, which says the deadline covers +`"0"` waits. An `attach` to a stalled server is still refused at its bound. +Update `doc/bin/relay/config.md`, which says the deadline covers "transport through MoQ SETUP", and note the behavior change for slow auth servers in the relay changelog. From ae45e82381e8a2e87f0c63ed9f78b33ec4b83f16 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 11:07:15 -0700 Subject: [PATCH 4/6] quest(m1): list moq --listen and Auth::admit among admission callers Co-Authored-By: Claude Opus 5.5 --- quest/m1/handshake-admission-deadline.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md index c185e924478..5a46e6c5486 100644 --- a/quest/m1/handshake-admission-deadline.md +++ b/quest/m1/handshake-admission-deadline.md @@ -32,10 +32,13 @@ Gaps found in this plan's review, to settle with the maintainer at start: - Dropping the shared cap leaves the other `Auth::admit` callers unbounded: WebSocket admission before the upgrade (`websocket.rs`), HTTP admission - (`admit_http` in `web.rs`), and the public `Cluster::admit` for gateway - sessions. Recommendation, following the decision above: the web callers - race the web listener's timeout, which is the same `listen.timeout`, and - `Cluster::admit` documents that the embedder owns the deadline. + (`admit_http` in `web.rs`), `serve_client` in `rs/moq-cli/src/main.rs` + for `moq --listen`, and the public `Auth::admit` and `Cluster::admit` for + embedders. Recommendation, following the decision above: the web callers + race the web listener's timeout, which is the same `listen.timeout`; + `moq --listen` races its own listener's `listen.timeout`; and `Auth::admit` + and `Cluster::admit` document that they wait on the decider and the caller + owns the deadline. - `moq_auth::Client` sets a 10 s reqwest timeout on every request (`rs/moq-auth/src/client.rs`), so an HTTP auth server answering `connect` after 10 s is still refused. Only `connect` drops that fixed bound and @@ -54,6 +57,6 @@ Update `doc/bin/relay/config.md`, which says the deadline covers "transport through MoQ SETUP", and note the behavior change for slow auth servers in the relay changelog. -Public API: no signature changes; `Cluster::admit` and +Public API: no signature changes; `Auth::admit`, `Cluster::admit` and `moq_auth::Client::connect` no longer time out on their own. Config: `listen.timeout` now includes admission. Wire: none. From 63c88766306fb6c4d0827aa1be9ab069a2b39fdb Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 11:12:17 -0700 Subject: [PATCH 5/6] quest(m1): plan the Request deadline API and the auth doc update Co-Authored-By: Claude Opus 5.5 --- quest/m1/handshake-admission-deadline.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md index 5a46e6c5486..fd731b116e7 100644 --- a/quest/m1/handshake-admission-deadline.md +++ b/quest/m1/handshake-admission-deadline.md @@ -45,6 +45,12 @@ Gaps found in this plan's review, to settle with the maintainer at start: inherits the caller's deadline. `attach` (in-band AUTH, which shares the `connect` path), `revalidate` and `end` run after the handshake and keep theirs, like grant renewal, so a stalled server cannot pile up requests. +- `moq_tokio::server::Request` keeps its handshake deadline private and + applies it only in `ok()`, after admission, so `connection.rs` cannot race + admission against it today. Recommendation: a public `Request` method that + bounds a future by what remains of the deadline, keeping the deadline itself + private, mirrored on the io_uring request if it has the same shape. Do not + start a fresh timeout at admission; the deadline runs from the first packet. Race inside the task that owns the admission, or cancel it, so an expired deadline does not leave admission work running detached. @@ -54,9 +60,13 @@ auth server: an admission that never answers closes at the deadline, one answered just inside it (past 10 s for the HTTP server) is admitted, and `"0"` waits. An `attach` to a stalled server is still refused at its bound. Update `doc/bin/relay/config.md`, which says the deadline covers -"transport through MoQ SETUP", and note the behavior change for slow auth +"transport through MoQ SETUP", and `doc/bin/relay/auth.md`, which promises +that an embedded admission left unanswered for ten seconds is refused; the +embedder now owns that deadline. Note the behavior change for slow auth servers in the relay changelog. -Public API: no signature changes; `Auth::admit`, `Cluster::admit` and -`moq_auth::Client::connect` no longer time out on their own. Config: +Public API: a new `moq_tokio::server::Request` method to bound admission by +the handshake deadline. `Auth::admit`, `Cluster::admit` and +`moq_auth::Client::connect` keep their signatures but no longer time out on +their own. Config: `listen.timeout` now includes admission. Wire: none. From 7ac448ee93b3ad69148f9703b80c8a790d7935e5 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 13 Oct 2026 11:17:11 -0700 Subject: [PATCH 6/6] quest(m1): test that expired connects are dropped; note moq-auth changelog Co-Authored-By: Claude Opus 5.5 --- quest/m1/handshake-admission-deadline.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md index fd731b116e7..3e2de3bf143 100644 --- a/quest/m1/handshake-admission-deadline.md +++ b/quest/m1/handshake-admission-deadline.md @@ -58,12 +58,14 @@ deadline does not leave admission work running detached. Tests on controlled time for each caller, the embedded decider and an HTTP auth server: an admission that never answers closes at the deadline, one answered just inside it (past 10 s for the HTTP server) is admitted, and -`"0"` waits. An `attach` to a stalled server is still refused at its bound. +`"0"` waits. At the deadline the HTTP server sees its `connect` request +dropped, so expired admissions leave no in-flight requests behind. An +`attach` to a stalled server is still refused at its bound. Update `doc/bin/relay/config.md`, which says the deadline covers "transport through MoQ SETUP", and `doc/bin/relay/auth.md`, which promises that an embedded admission left unanswered for ten seconds is refused; the embedder now owns that deadline. Note the behavior change for slow auth -servers in the relay changelog. +servers in the `moq-relay` and `moq-auth` changelogs. Public API: a new `moq_tokio::server::Request` method to bound admission by the handshake deadline. `Auth::admit`, `Cluster::admit` and