diff --git a/quest/m1/README.md b/quest/m1/README.md index 9ea44466da9..bd3068cdf7b 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -158,6 +158,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 @@ -174,6 +175,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 - [JS cancellation bench](/quest/m1/js-forget-bench.md) - the requests bench sweeps cancellation over competing dynamic routes, so a per-cancel cost that grows with routes shows as a slope - [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 diff --git a/quest/m1/handshake-admission-deadline.md b/quest/m1/handshake-admission-deadline.md new file mode 100644 index 00000000000..3e2de3bf143 --- /dev/null +++ b/quest/m1/handshake-admission-deadline.md @@ -0,0 +1,74 @@ +# [M] 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. + +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`), `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 + 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. + +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. 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 `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 +`moq_auth::Client::connect` keep their signatures but no longer time out on +their own. 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.