Repository navigation
Conversation
A copy's update loop decided whether a demand range already placed a reader's live join from the max it last recorded asking plus the range's current max. A range answered before any update never had its first max recorded, so once retuned wider the loop took an answer recorded under the narrower max as placing the wider reader, sent no probe, and the track (which places by the recorded budget) left the reader waiting for good. Record each answer's budget beside its tick and judge by it, as the track does. 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 4 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. |
|
Closing as a duplicate of #9735, which fixes the same bug: an answer recorded under max 0, then a retune wider, so no probe is sent. It does so with a smaller change, by keeping the answered budget in (Written by Claude Opus 5.5) |
Problem
A copy that answered a lite-07 live join before a retune wider never probes for the wider budget, so its readers wait forever.
The sequence:
max = 0and records the publisher's SUBSCRIBE_START as the join's answer: a tick plus the budget it was asked under (0).max = 100msbefore it is placed.joinProbesonly checks that the answer's tick is newer thanjoin.since, then comparesmin(asked, now) >= join.budget.joinBudgetsstops recording once a range is answered, soaskedis unbounded andnowis the new 100 ms max. The probe is skipped.answer.budget >= reader.budget(track.ts/TrackState::join_answer). An answer recorded under 0 never places a 100 ms reader, so the ordered read holds every group forever.JS and Rust have the same bug. A browser player stalls with zero frames even though the relay keeps serving groups. In an end-to-end suite where a page subscribes and then raises its max age, this hit roughly 1 in 4 runs.
Approach
Store the budget next to the tick when a join is answered (
JoinAnswered { tick, budget }, replacingjoin_ticks/joinTicks). An answered range answers a join only if both hold:join.since;join.budget.This is the same predicate the track uses to place a reader, so the subscriber probes exactly when the track would refuse the answer. The unanswered branch is unchanged.
Validation
a join answered before a retune wider is probed(JS) anda_join_answered_before_a_retune_wider_is_probed(Rust). Both fail on main ("an answer recorded under max 0 places no reader at 100 ms") and pass here.just check: everything excepttest jspasses, including the Rust suite (11656 tests) and all@moq/nettests (3959 pass, 0 fail).test jsreports one unhandled error between tests fromcopy_fill.test.ts:66. That is a pre-existing flake: 3 of 16 runs on main'ssubscriber.ts, and 1 of 8 with this change.Impact
No public API or wire change. Behavior: the copy now sends a probe range in the retune-wider-after-answer case, where it used to send nothing.
Caused by
Follow-ups
js/net/src/lite/copy_fill.test.ts:66throwsexpected a valuefromdefined(group)between tests in about 1 of 6 runs on main. Its fill loop'sfill.accept(key)can return nothing after the test closes.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)