Repository navigation
fix(moq-tokio)!: a backoff timeout set in code wins over the parser default - #5350
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 5c296e0
No actionable bugs found in the changed code and inspected call sites.
Direction: distinguishing unset from explicit zero with Option, removing the parser default, and centralizing flag → typed value → 10s resolution is a focused fix. The documented Rust API break is reflected in the in-tree callers, while the C/FFI representations remain unchanged. Keeping the broader duration-parser cleanup separate is reasonable.
Verification: inspected all 11 changed files, the settings merge/serialization path, retry-window consumption, and native adapters. Regression tests cover parsed and round-tripped configs plus explicit flag precedence. This was a GitHub-only static review; I did not run builds or tests or independently verify the reported test results.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughReconnect backoff timeouts now use an optional duration. The effective retry window is selected from the CLI value, the configured value, or the default. The change adds Serde support for optional durations and updates C, FFI, GStreamer, and relay configuration callers to use the optional value. Tests cover timeout defaults, zero and nonzero values, precedence, and TOML round-tripping. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
…efault The parser stores a declared default exactly as if the flag had been given, so on a config built from the command line --backoff-timeout's 10s beat Backoff::timeout whatever it said, and a zero there could not be told apart from the field left unset. A config parsed and then set to retry forever still gave up after 10s. Backoff::timeout is now an Option, so None is unset and Some(ZERO) is unlimited, and the flag has no parser default: it is present only when given, and the 10s default applies after the typed field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#5237 added three tests that set Backoff::timeout as a bare Duration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5c296e0 to
8dd376e
Compare
|
Merging. Rebased onto main after #5335 and #5284. The only change beyond the rebase: #5237's three new The follow-up for the other (Written by Claude Opus 5.5) |
Problem
Backoff::timeoutdocuments0as unlimited retries, but that only worked through--backoff-timeout 0orMOQ_BACKOFF_TIMEOUT=0. On a config the command line built, a value set in code had no effect:default_value_tby formatting it and parsing the string back, soCliDuration::fallback(10s)reaches the struct as an explicit10s, andCliDuration::resolvereturns it over the typed field.#[usage(skip)]field atDuration::ZERO, whichresolvereads as "unset". A zero set afterwards looked the same as no value at all.So
config.backoff.timeout = Duration::ZEROon a parsed (or settings-merged) config still gave up after 10s. A probe againstmainresolved 10s for a parsed config set to zero, and 10s for a merged config set to either 3s or zero. In-tree,Cluster::lan_clientsets zero on the relay's merged connect config.Approach
Backoff::timeoutbecomesOption<Duration>.Nonemeans unset, andSome(Duration::ZERO)means unlimited.Backoff::default()still holdsSome(10s).--backoff-timeouthas no parser default, so it is present only when actually given (flag or env). The window in effect is the flag, then the typed field, then 10s.[default: 10s]for the flag. The doc comment still says it.Impact
moq_tokio::Backoff::timeoutgoes fromDurationtoOption<Duration>. In-tree callers updated: moq-c, moq-ffi, moq-gst, moq-relay, tests.moq_client_defaultsstill reports 10s withhas_backoff_timeoutset.connection.rstests setbackoff.timeoutto a bareDuration; they now wrap it inSome(...). fix(moq-tokio): the retry window no longer cuts a dial short #5352 and fix(moq-tokio): a restarting peer's GOAWAYs do not exhaust the retry window #5351 wrap theirs when they rebase onto this.Validation
connection::tests::a_timeout_set_in_code_beats_the_parser_defaultcovers a parsed config, a merged config (zero and nonzero), an explicit flag still winning, and a config built in code. Restoring the parser default fails it:a parsed config,left: 10s, right: 0ns.nix develop --command just checkpassed: 3,806 Rust tests (13 skipped) plus the moq-c, moq-gst, FFI and Python suites.Follow-up
The same parser behavior affects every other
CliDuration-backed field: connect timeout, race, resolution delay, GOAWAY handover, QUIC idle timeout and keep-alive, listen timeout, WebSocket delay, and backoff initial and max. On a parsed or merged config, a value set in code is ignored, becausefallbacknever survives the parse and every*_argcomes out explicit. Keep-alive has the same zero ambiguity, since zero disables it. This is planned inquest/m1/cli-duration-defaults.md(#5387): move every one of these fields to the shape used here.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.