Skip to content

refactor(tokio)!: resolved config reports off as None - #8371

Merged
kixelated merged 2 commits into
mainfrom
quest/m2/tokio-resolved-options
Nov 9, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m2/tokio-resolved-options

Conversation

@kixelated

@kixelated kixelated commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes moq-dev/moq#8265 for moq-tokio: resolved values say "off" with Option, not zero. The text knobs (CLI, TOML, env, FFI, C, GStreamer) keep 0 = off; the conversion happens once, in resolve().

Completes quest/m2/tokio-resolved-options.md (deleted here).

Changes

  • connection::Backoff::{max, timeout}() return Option<Duration>; None = uncapped / retry forever.
  • connect::Resolved.timeout is Option<Duration>; a configured zero resolves to None, which Client hands to moq-net's policy directly.
  • quic::Resolved.idle_timeout is Option<Duration> and goes straight to moq-quic's transport.idle_timeout (whose None is "no idle timeout"); keep_alive_interval no longer re-filters zero.
  • quic::Resolved.keep_alive also folds a configured zero into None (it already documented "None or zero" as the same thing).
  • Boundaries that spell off as zero (moq-c, moq-ffi defaults, GStreamer properties, moq-uring's transport config) convert back with unwrap_or_default().

Choices made without asking

  • GOAWAY handover stays a Duration: zero there is a real window (close the old session at once), not "unlimited", and moq-net's reconnect::Goaway.handover is a Duration, so an Option would add a state with no meaning.
  • Audited the other Resolved structs: connect::Resolved.{race, resolution_delay} and websocket delay treat zero as a real (immediate) duration, and listen::Config::resolved_timeout() already returns Option. No change.
  • No overlap with moq-dev/moq#8370: it had no committed diff when this pushed; this PR touches only Backoff's accessors and test macros in connection.rs.

Impact

Public API (breaking, moq-tokio): Backoff::max(), Backoff::timeout(), connect::Resolved.timeout, and quic::Resolved.idle_timeout become Option<Duration>; quic::Resolved.keep_alive is never Some(ZERO).
Migrate: compare against None instead of Duration::ZERO; where a zero is needed (FFI-style "0 = off"), use .unwrap_or_default().
Wire: none. FFI/C/GStreamer surfaces unchanged.

Caused by

No single PR: the zero-as-off resolution predates moq-dev/moq#8265, which fixed the moq-net side.

Checks

just check passes locally.

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, low effort

🤖 Generated with Claude Code

(Written by Opus 5.5 with low)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1c083-cbec-7e12-bd0b-424fb7f64128, round 1
  • Head: e0a1126
  • Base: origin/main at bad28ce
  • Score: 9/10, The refactor preserves zero-as-disabled behavior across connection policy, QUIC backends, and bindings while exposing resolved values as Option; source inspection found no actionable regressions, but builds and tests were not run as instructed.
  • Findings: none

kixelated and others added 2 commits November 9, 2026 05:14
connect::Resolved.timeout, quic::Resolved.{idle_timeout, keep_alive}, and
Backoff::{max, timeout}() turn a configured zero into None where the text
knobs resolve; CLI/TOML/env/FFI/C keep zero = off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title moq-tokio's resolved config reports "off" as None refactor(tokio)!: resolved config reports off as None Nov 9, 2026
@kixelated
kixelated marked this pull request as ready for review November 9, 2026 13:34
@coderabbitai

coderabbitai Bot commented Nov 9, 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 11 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b504741-6f81-4629-8c9f-0c553d90e6f8
Commits

Reviewing files that changed from the base of the PR and between bad28ce and e0a1126.

Files selected for processing: 17

  • quest/m2/README.md
  • quest/m2/tokio-resolved-options.md
  • rs/moq-c/src/api.rs
  • rs/moq-c/src/test.rs
  • rs/moq-ffi/src/session.rs
  • rs/moq-ffi/src/test.rs
  • rs/moq-gst/src/connection.rs
  • rs/moq-gst/src/sink/imp.rs
  • rs/moq-relay/src/cluster.rs
  • rs/moq-relay/src/uring.rs
  • rs/moq-relay/tests/drills.rs
  • rs/moq-relay/tests/integration/goaway_cluster.rs
  • rs/moq-tokio/src/client.rs
  • rs/moq-tokio/src/connect.rs
  • rs/moq-tokio/src/connection.rs
  • rs/moq-tokio/src/quic.rs
  • rs/moq-tokio/src/quic/backend.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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

A behavior-preserving refactor that finishes #8265 for moq-tokio: resolved config values now spell "off" as None instead of zero, with the conversion done once in resolve().

  • Backoff accessors: connection::Backoff::{max,timeout}() return Option<Duration>; None means uncapped / retry forever. resolve() already mapped a configured zero to None, so only the accessors and their test macros changed.
  • Dial deadline: connect::Resolved.timeout is now Option<Duration>; a configured zero filters to None in resolve() and reaches moq_net::reconnect::Config.timeout directly, replacing the .filter(|t| !t.is_zero()) in Client::init.
  • QUIC knobs: quic::Resolved.idle_timeout is Option<Duration> and goes straight to the backend transport; keep_alive now folds a configured zero into None, and keep_alive_interval() no longer re-filters it.
  • Zero-spelling boundaries: moq-c, moq-ffi, GStreamer, and moq-uring convert back with unwrap_or_default(), so their external surfaces still mean 0 = off.
  • Relay: cluster peer_client checks timeout().is_none() instead of is_zero() — equivalent, since unset and zero both resolve to None.
  • Quest: quest/m2/tokio-resolved-options.md and its README entry are removed.

I confirmed the boundaries are numerically identical to main: moq-quic's keep_alive_interval already treats Some(ZERO) like None, an idle timeout of Some(0) and None both disable it (max_idle_timeout / negotiate_max_idle_timeout), and the FFI/C reported defaults are unchanged. No remaining consumers of the old Duration spellings exist in the workspace, and leaving GOAWAY handover as a Duration is right since zero there is a real (immediate) window.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head: e0a1126 (base: bad28ce).

No actionable findings. The direction is sound: normalize zero-as-disabled at resolution, pass Option<Duration> into the runtime policy, and translate back only at zero-based boundaries. I traced reconnect deadlines, QUIC idle-timeout negotiation and keep-alive derivation, relay peer retries, and the C/FFI/GStreamer/io_uring conversions; the existing disabled/default behavior is preserved. Keeping GOAWAY handover as a duration also preserves its immediate-close meaning at zero.

Verification: GitHub source review only; builds and tests were not run. The updated duration tests cover unset, zero, and nonzero values. GitHub Check for this head is still in progress, so this is not a completed CI verification.

@kixelated
kixelated added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 99b1a0c Nov 9, 2026
14 checks passed
@kixelated
kixelated deleted the quest/m2/tokio-resolved-options branch November 9, 2026 18:23
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