Skip to content

fix(relay)!: keep the default stats interval when the CLI omits it - #6655

Merged
kixelated merged 1 commit into
mainfrom
fix/stats-interval-default
Oct 24, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/stats-interval-default

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

moq-relay --stats-enabled without --stats-interval refuses to start with stats.interval must be non-zero. #6472 made stats::Config::interval a #[usage(skip)] Duration, and the CLI parser fills a skipped field with its type's zero rather than the struct's Default, so a relay configured from flags alone builds stats with a zero interval. The old interval.max(1) used to hide that. interval is now an Option<Duration>, the same as linger: None keeps the producer's 1s default, and an explicit zero is still refused.

A staging edge on a pin carrying #6472 crash-looped on exactly this at startup.

Impact

Tests

  • config::tests::cli_stats_build_without_an_interval parses --stats-enabled alone and builds the stats producer. Without the fix the parse yields a 0ns interval.
  • just check passes.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T16:40:04.486118Z 79f1741 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
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: a5571156-ef30-4353-ae33-7dacd0810d4a
Commits

Reviewing files that changed from the base of the PR and between c0145f1 and 79f1741.

Files selected for processing: 4
  • rs/moq-relay/MIGRATE.md
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/stats.rs
  • rs/moq-relay/tests/integration/wire_stats.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

The statistics configuration now uses Option<Duration> for its interval and defaults to no configured interval. Command-line intervals take precedence over configured intervals. The build step rejects a zero interval when one is present and applies an interval to the producer configuration only when a value is set. Tests and the migration guide reflect the updated type.

Priority: Normal

Merge Risk: Minimal · up to 79f17

No actionable merge-blocking risk is identified in this change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: preserving the default stats interval when the CLI omits an interval.
Description check Passed The description directly explains the zero-duration startup failure, the Option fix, compatibility impact, and test coverage.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.99.0)

Clippy execution timed out

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.

@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit de9ff79 Oct 24, 2026
9 checks passed
@kixelated
kixelated deleted the fix/stats-interval-default branch October 24, 2026 18:16
kixelated added a commit that referenced this pull request Oct 24, 2026
Keeps this branch's single stats interval field; per #6655, an unset interval keeps the producer's default.

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