feat: make BLQ stale threshold and static friction runtime-configurable#7880
Merged
feat: make BLQ stale threshold and static friction runtime-configurable#7880
Conversation
…-options Replaces the hardcoded 30m stale threshold and 2m static friction in BLQRouter with two sentry-options keys (consumer.blq_stale_threshold_seconds, consumer.blq_static_friction_seconds) read per-submit, matching the hot-reload behavior of consumer.blq_enabled so these knobs can be tuned without a consumer restart. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b376219. Configure here.
xurui-c
approved these changes
Apr 16, 2026
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.

This PR is just replacing hardcoded constants with options so I can change the value at runtime. This is necessary for testing in s4s, I dont want to create an actual backlog of 30 minutes, so I will reduce stale threshold to say 4 minutes and test that.
Summary
BLQ_STALE_THRESHOLD(30m) andBLQ_STATIC_FRICTION(2m) with two sentry-options keys:consumer.blq_stale_threshold_seconds(default 1800) andconsumer.blq_static_friction_seconds(default 120).BLQRouternow reads both values per-submit()the same wayconsumer.blq_enabledis read, so they hot-reload without a consumer restart. Friction <= 0 disables friction; friction >= threshold is ignored at runtime.BLQRouter::newarguments fromfactory_v2.rs.Test plan
cargo checkcleancargo clippy --lib -- -D warningscleancargo test --lib blq_router— 4/4 pass, tests now set thresholds viaoverride_optionsblq_enabled=trueandblq_stale_threshold_seconds=5, confirm a 10s-old message routes to BLQ; flip the threshold to 3600 and confirm the next fresh message passes through without restart🤖 Generated with Claude Code