Keep the tunnel loss estimate moving when the tunnel stalls - #6
Merged
Conversation
The loss window closed only on fresh data, so a tunnel losing badly never closed one: new data slows to a trickle while retransmits pile up, and the estimate stayed frozen at whatever the last healthy period measured, often zero. Adaptive duplication derives its copy count from that estimate, so it could not rise during exactly the loss it exists to answer, and the tunnel sat at one copy per packet while retransmitting everything. Retransmits now close the window on their own once there is a window's worth of them. A window is still a window of fresh data in the normal case, so the measured ratio is unchanged for healthy traffic. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
tunnelLossMeterclosed its window only on freshSTREAM_DATA. A tunnel losing badly does the opposite of that: new data slows to a trickle whileSTREAM_RESENDpiles up, so the window never completed andlastPerMillestayed frozen at whatever the last healthy period measured — usually zero.adaptiveDuplicationCountderives the copy count from that estimate. With the floor at one copy, which is what the speed preset configures, duplication could not rise during exactly the loss it exists to answer: the tunnel sat at a single copy per packet while retransmitting nearly everything.Validation
duplicationForLosslifts the count off its floorTestTunnelLossMeter_UploadRetransmitRatestill passes unchanged, which is the check that the healthy-traffic ratio was not redefinedgo build ./...,go vet ./..., andgo test ./...pass🤖 Generated with Claude Code