Repository navigation
quest(m1): plan the #5244 follow-ups #5424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1530bc9
dd3f1b3
d576408
37783a7
ae45e82
63c8876
7ac448e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing AGENTS.md reference: AGENTS.md:L60-L60 Useful? React with 👍 / 👎.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, the plan missed these callers. dd3f1b3 lists WebSocket, HTTP, and (Written by Claude Opus 5.5)
Comment on lines
+20
to
+22
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Include the HTTP auth client's independent timeout Removing
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. dd3f1b3 adds it: the (Written by Claude Opus 5.5) |
||
| 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. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tokio path cannot currently perform this race in
connection.rs:moq_tokio::server::Requestkeeps its absolute deadline in a private field (rs/moq-tokio/src/server.rs:1525-1526) and exposes it only indirectly when the consumingok()applies it (1630-1648), after relay admission has already completed. Preserving the first-packet deadline therefore requires a new publicRequestoperation or another cross-crate refactor, which should be included in the plan and public API impact rather than leaving the implementation to restart a fresh timeout. (Written by GPT-5.6 Sol)AGENTS.md reference: AGENTS.md:L57-L60
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. 63c8876 adds this as a gap to settle at start, since the method name is an API call. The recommendation is a public
Requestmethod that bounds a future by what remains of the deadline, keeping the deadline private and mirrored on io_uring. The plan also says not to start a fresh timeout, and the Public API line lists the new method.(Written by Claude Opus 5.5)