Repository navigation
fix(quic): keep the MTU search above its confirmed size - #9805
Conversation
After a lost probe, the binary search re-probed its lower bound and, with minimum_change 1, could invert its range and adopt an MTU below min_mtu. Probe only sizes above the confirmed one and end when none remain. Also assert that stopping a stream with a dropped lease grants its credit back to the peer in a MAX_DATA frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe MTU search now selects probes above the largest confirmed size and stops when no valid probe remains. A new test checks probe bounds and the final confirmed MTU. The README documents the search behavior. A stream test now checks that stopping a stream returns held credit and queues a MAX_DATA frame. Merge Risk:
|
Problem
Two CodeRabbit points left on #9801:
minimum_change = 1, lower 1200 and upper 1201, losing 1201 three times probes 1200 (already confirmed), and losing that three times inverts the range and probes 1199. An ACK then setscurrent_mtubelowmin_mtu. Withminimum_change = 2the search still wastes probes on the confirmed size. Reproduced: the new test failed onmainwith[1201, 1201, 1201, 1200, 1200, 1200, 1199].stop_recovers_a_dropped_leasechecked onlycredit_stats().leased, not that the peer gets the credit back.Approach
SearchState::next_mtu_to_probetakes the candidate range as (largest confirmed, largest not ruled out], returnsNoneonce it is empty, and never picks the confirmed size itself. Every probe is now abovelower_bound, so the retransmit upper bound (last_probed_mtu - 1) can never fall below it. The success branch's behavior is unchanged (existing exact-sequence tests pass as is).search_probes_only_above_its_lower_boundsweeps upper bounds 1201..1209,minimum_change1..3, and every link limit (including one that loses every probe), asserting every probe lies in1201..=upper_bound, the search completes, andcurrent_mtustays between 1200 and the link limit. Time isInstant::ZEROthroughout.stop_recovers_a_dropped_leasealso assertslocal_max_datarises by the returned credit and the stop queuesMAX_DATA.rs/moq-quic/README.mdlists the fix under carried changes.Impact
minimum_changeof 1 or 2 no longer re-probes its confirmed size or adopts an MTU below it.Caused by
Decisions
last_probed_mtu.saturating_sub(1).max(lower_bound)), which would still re-probe the confirmed size.upper_bound >= lower_bound: the sweep test covers it, and every probe being abovelower_boundmakes it hold by construction.Alternatives
Follow-ups
Validation
main, passes with the fix; all 33mtudtests pass.grant()inadd_read_creditsfails the strengthened lease test only on the newlocal_max_dataassertion, which the old assertions missed.quest gate just checkpasses.Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown (arm A)
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 31d8928
Base: origin/main at d0beaa0
Risk: medium,
A bug in the MTU search's bounds could make a relay or client probe the wrong packet sizes, so a connection settles on a smaller or unstable MTU, hurting throughput for the peers of the moq-quic crate and not breaking the API or wire format; the change is a behavior fix in shipped code that a revert fully undoes, and the state.rs edit is test-only and the README line is documentation.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
11532d8a-4b3b-4ab1-9798-e95ebc02800fRisk file: bb7b1c0de60b
Reviewer: Codex, gpt-6.2-sol, medium effort
Session:
01a21f68-d476-7853-b0db-5df21925b562, round 2Score: 10/10,
The regression test now checks each probe against the latest confirmed MTU, and the README accurately describes the retry and stopping conditions.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none