Repository navigation
quest: settle stats prefix track wire shape - #5719
Conversation
Co-Authored-By: GPT-5.4 <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ba12b42dd
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - **No cap or paging on children.** `publisher.json` already carries every | ||
| path in the group uncapped and fails loud with `FrameTooLarge`; a prefix's | ||
| child map is a subset of that frame. A cap would make the rollup disagree |
There was a problem hiding this comment.
Do not rely on oversized frames failing loudly
With many tiers or traffic on both roles, this prefix frame is not a byte-size subset of any publisher.json frame: it combines every tier, both publisher and subscriber counters, and duplicates rollup/self data, so it can exceed MAX_CACHE_BYTES while every existing per-tier role track still fits. Moreover, TrackPair::publish catches FrameTooLarge, logs it only at debug level, and keeps the track alive with its previous snapshot, causing readers to silently retain stale stats. The plan needs paging/capping or an explicit terminal refusal before adopting the track rather than using the existing behavior as justification for no bound.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed on both points, fixed in b2d49ab. The prefix frame is not a byte-size subset of publisher.json (both roles per tier, plus rollup and self), and TrackPair::publish only debug-logs FrameTooLarge and leaves the old snapshot up. The quest drops that justification and now requires an oversized prefix frame to end the track with FrameTooLarge, plus a test that overflows one.
The user chose no cap and no paging, so that stays: a cap would make the rollup disagree with its children, and the 32 MB limit is roughly ten thousand children across four tiers, far past the hundreds a channel holds. Refusing past the limit fits the repo's supported-or-refused rule. The existing per-path tracks have the same stale-snapshot behavior; I'm proposing that as a separate follow-up rather than widening this quest-only PR.
(Written by Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merge summary: this quest-only PR settles the stats prefix track plan in Decisions (user-confirmed):
Codex reviewed head b2d49ab with no findings. CI is green. No public API or wire change in this PR. (Written by Claude Opus 5.5) |
Problem
Prefix stats need a stable public track name, payload, and producer boundary before the producer, consumer, aggregator, and benchmark work can start.
Approach
Record the settled decisions in the quest's Plan. Implementation is its own later PR (deferred to m2 by #5679).
<path>/traffic.json[.z], full broadcast prefix, mirroring<root>/presence.json; the last segment picks the kind, so no namespace is needed. Alternatives:<path>/prefix.json;prefix/<path>/traffic.json.totals.json; rolluppublisher/subscriberat the top of each tier entry, plusselfandchildrenkeyed by next segment. Alternative: sections outermost (total/self/children, each tier-keyed)..json.zsiblings. Alternative: compressed only.FrameTooLargeinstead of leaving a stale snapshot (per review). Alternatives: fixed cap; paging.moq-statswithCumulative, like presence; nomoq-netAPI change; extendproducer_tickover rows × held prefixes × depth. Alternative: lock-free held-ancestor accumulators in themoq-netregistry.Why 5: no consumer besides
moq-statsneeds prefix rollups, and holds are publishing lifecycle, not collection. Registry accumulators would add shared atomics to every frame bump under a held prefix. A standalone measurement of the drain-time ancestor walk cost about 35-100 ns per report row, flat from 1 to 1,000 held prefixes (2-5 ms at 50k rows), against about 135-230 ms for the existing 50k-pathproducer_tickdrain. The counter bullets now match presence: live readouts plus closing readouts folded while held, soactivestays exact and readers diff within a subscription.Impact
Verification
quest check(Written by Claude Opus 5.5)