fix(router): adaptive tick evicts low-throughput legs, not just dead ones - #4201
Merged
Merged
Conversation
…ones The active-mux health gate only evicted legs that passed ZERO traffic while the group was loaded. A leg that carries a small FRACTION of what its peers do — a webrtc data channel next to stcpr legs, say — sailed through, yet it drags the no-skip reorder buffer exactly like a dead leg: the buffer head-of-line-stalls waiting for that leg's slow-arriving sequences. Grade the stall gate by throughput. Track a per-leg EWMA recv byte-rate; a leg whose rate is below adaptThroughputOutlierFrac (0.25) of the active-set MEDIAN rate, sustained over adaptHysteresis ticks, is a low-throughput outlier and is evicted (hot-swapped for a healthy standby, never leg 0) like a stalled leg. Zero traffic is the frac=0 special case, so this strictly widens the old gate. Using the MEDIAN (not max) makes it robust to the selector concentrating traffic on one leg: when most active legs carry a similar share and one carries <25% of it, only that one is flagged; uniformly-underselected legs never false-trigger. bundle.wasm regenerated (TinyGo); parity_test (wazero) green. New tests cover the legLowThroughput classifier and end-to-end eviction of a sustained low-rate leg.
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.
The active-mux health gate only evicted legs passing zero traffic under load. A leg carrying a small fraction of what its peers do — a webrtc data channel beside stcpr legs — sailed through, yet it drags the no-skip reorder buffer just like a dead leg (the buffer head-of-line-stalls on its slow-arriving sequences).
Grade the stall gate by throughput: track a per-leg EWMA recv byte-rate; a leg below 0.25 × the active-set median rate, sustained over the health hysteresis, is a low-throughput outlier and is evicted (hot-swapped for a healthy standby, never leg 0). Zero traffic is the frac=0 special case, so this strictly widens the old gate.
Using the median (not max) makes it robust to the selector concentrating traffic on one leg — uniformly-underselected legs never false-trigger; only a genuine low outlier does.
bundle.wasmregenerated (TinyGo);parity_test(wazero) green. New tests cover the classifier and end-to-end eviction.