Repository navigation
Rate regulator: at most 500 keep-count lines per service per window past its total (E90) - #116
Merged
Merged
Conversation
…ast its total A keep-count line (one of the first K held lines of an ERROR, CRITICAL or FATAL pattern in a window) now reserves the service total like any line. Past the total, a service passes at most keepMaxOverTotal of them per window (default 500, counter rg_kx_<container>); the rest take the service's action. 0 removes the bound. Lines an active mute entry passes are unchanged. Both cap-file variants; config.yaml and schema.json carry the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e1: 1,422 new ERROR patterns of 7 lines over a 1-byte cap and a 100-line total pass 650 (the total, 50 sample lines, 500 keep-count lines), not 9,954. e2: keepMaxOverTotal 0 passes all 9,954. e3: e1 with a mute file present, the mute and cap regulator. On edge-10x 1.1.150: e1 and e3 fail on main and pass on the fix; k1 to b3 and w1 pass on both. run.sh starts each engine with docker run -d --name (PREFIX) and removes it with docker rm -f -v, waits for the Forward input's listening line before a paced case sends, and defaults to edge-10x 1.1.150. Co-Authored-By: Claude Opus 5.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.
Engineering ask E90, option B as ruled. Needs log-10x/modules#157 (the declaration of
rateReceiverKeepMaxOverTotal); a config key without its declaration fails launch, so modules#157 merges first.Change
keepMaxOverTotal(optionrateReceiverKeepMaxOverTotal, default 500, 0 = unbounded) in both cap-file regulators (rate-object-cap.js,rate-object-lookup-cap.js), modelled onbaselineMaxOverTotal:keepCountswhose pattern is under K this window (rg_kc_, unchanged) is a keep line.rg_pas_) like a regular line. If it fits, it passes and counts toward the total.rg_kx_<container>is under the allowance. The rest take the service's action.Past the total means what it means for the sample bound: a line the reservation against
rg_pas_refuses.rg_sx_counts only sample lines the total refused;rg_kx_counts only keep lines the total refused. Every other path is unchanged: regular lines, the sample bound, K per pattern, and mute-entry lines (the mute path returns before the keep test). With 0, the units added torg_pas_match today's for every line.Worst case per service per node per window with the shipped settings: total + 50 sample lines + 500 keep-count lines (+ mute passes, + warm-up when set).
rate-object-local.jsandrate-object-lookup.jsread no total and are unchanged.config.yamladds the key and updates thekeepCountsand total-file comments.schema.jsonis regenerated from the modules#157 text the wayJsonSchemaGeneratorbuilds it (checked against the untouchedbaselineMaxOverTotalandbaselineCountentries).Gate:
tests/regulator,ghcr.io/log-10x/edge-10x:1.1.150(sha256:3e755bbc), fix = this branch + modules#157 mountedThe image's bundled rate files and module.yaml are byte-identical to config/modules main, so the main arm is main.
Every existing case passes on the fix with the same counts as main. The paced cases w2 to w4 ran after the rest, with run.sh's wait for the Forward input's listening line, which needed no change.
Harness
docker run -d --name $PREFIX-...and removes it withdocker rm -f -v(it no longer usesdocker run --rmin the foreground).🤖 Generated with Claude Code