Skip to content

fix(clock): migrate auth, RTMP, and archive clocks - #5987

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/time/crates
Oct 20, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/time/crates

Conversation

@kixelated

@kixelated kixelated commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Mixed clocks make controlled-time behavior disagree: an auth session reported 119 microseconds after 60 paused seconds, both RTMP roles still reported timestamp zero after 12.345 paused seconds, and listener exhaustion reported 37 microseconds after 30 paused seconds. JWT verification also rejected a token valid on the simulator's wall clock.

Approach

Use the ambient clock for auth accounting, JWT checks, policy expiry, RTMP session timestamps and deadlines, archive retention, and listener stall accounting. RTMP timestamps retain their 32-bit millisecond wrap. Add six controlled-time regressions and per-crate clock lint ratchets for auth, RTMP, and archive, with legacy test-only clocks left for the existing m2 sweep.

Impact

  • Public API: no signature or exposed-type changes in this checkpoint. Existing public SystemTime fields still need migration.
  • Wire: no format changes. RTMP control timestamps measure monotonic elapsed time; auth End durations follow the lease's clock.
  • No package version changes.

Alternatives

Reuse the grant-deadline migration already landed in #5920. Keep foreign-clock and blocking-device boundaries unfinished instead of adding host-clock conversions at each call site.

Follow-ups

This is a partial checkpoint of the existing XL quest and stays draft. Other workspace production consumers and public wall-time types remain. SRT/WebRTC require std-clock instants at third-party boundaries, and audio/video threads need blocking clock support; that API work remains unresolved. The quest records this remainder and is retained.

Validation

  • Five regressions failed before their source fixes, with the observations above.
  • All six fixed regressions passed: auth session duration, JWT validity, policy expiry, RTMP client/server elapsed timestamps with wall-step and 32-bit wrap checks, and listener exhaustion duration.
  • quest check, git diff --check, and manifest ordering passed.
  • Full just check passed under the coordinator on unchanged checkpoint 5473d50ce.
  • The complete explicit native cross-language matrix passed on unchanged checkpoint 5473d50, including Node/Bun tails and published DROP lanes. The browser-inclusive just test interop --all gate is blocked by the shared environment: pinned Chromium 1248 cannot load libglib-2.0.so.0.
  • Backendless verification did not reach the listener regression: the existing, unchanged listen.rs test fixtures call Config::init/init_streams without a transport backend. A corrected library-only cargo invocation confirmed four compile errors; no unrelated fixture refactor is included.

(written by GPT-6.1-Sol)

kixelated and others added 3 commits October 19, 2026 12:12
Auth session durations and JWT validity use the ambient clock; archive retention deadlines use it too. Add clock lint ratchets while retaining test-only legacy clock exceptions.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
Reproduced zero RTMP elapsed time after 12.345 paused seconds and a 37 microsecond listener stall after 30 paused seconds. Migrate RTMP deadlines and add simulated wall-step and timestamp-wrap coverage. Keep the remaining workspace migration explicit in the quest.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Checkpoint 5473d50ce is pushed and the worktree is clean. Five regressions reproduced their original failures; all six fixed controlled-time regressions now pass. Quest validation, manifest ordering, and diff checks also pass.

The coordinator owns the pending full just check, just test interop --all, and no-default-feature listener-stall regression. This remains draft because the wider crate/public-wall migration and foreign-clock/device-thread API boundaries are unfinished; no public signature or wire-format changes were made here.

(written by GPT-6.1-Sol)

@kixelated
kixelated marked this pull request as ready for review October 19, 2026 23:37
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bdc8520f-828a-4ca1-8b8e-803d5c1c920b
📥 Commits

Reviewing files that changed from the base of the PR and between f37d19b and 5473d50.

⛔ Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 24
  • quest/m1/time/crates.md
  • rs/moq-archive/Cargo.toml
  • rs/moq-archive/benches/writer.rs
  • rs/moq-archive/clippy.toml
  • rs/moq-archive/src/lib.rs
  • rs/moq-archive/src/reader/mod.rs
  • rs/moq-archive/src/writer.rs
  • rs/moq-auth/MIGRATE.md
  • rs/moq-auth/clippy.toml
  • rs/moq-auth/src/claims.rs
  • rs/moq-auth/src/client.rs
  • rs/moq-auth/src/key.rs
  • rs/moq-auth/src/lease.rs
  • rs/moq-auth/src/serve.rs
  • rs/moq-auth/src/set.rs
  • rs/moq-rtmp/Cargo.toml
  • rs/moq-rtmp/clippy.toml
  • rs/moq-rtmp/src/dial.rs
  • rs/moq-rtmp/src/rml/mod.rs
  • rs/moq-rtmp/src/rml/sessions/client/mod.rs
  • rs/moq-rtmp/src/rml/sessions/server/mod.rs
  • rs/moq-rtmp/src/server.rs
  • rs/moq-tokio/Cargo.toml
  • rs/moq-tokio/src/accept.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T23:45:06.385627Z 5473d50 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated
kixelated added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 7a6a8d7 Oct 20, 2026
26 checks passed
@kixelated
kixelated deleted the quest/m1/time/crates branch October 20, 2026 00:47
kixelated added a commit that referenced this pull request Oct 20, 2026
…clock

#5987 migrated the JWT checks and ratcheted moq-auth, moq-rtmp, and
moq-archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant