Repository navigation
dashboard: a guard's drop rate names the same scope in every process - #928
Open
michaellchung wants to merge 1 commit into
Open
michaellchung wants to merge 1 commit into
michaellchung wants to merge 1 commit into
Conversation
BreakerState.drop_rates walked a set of (entry, scope) keys and kept the first scope with the worst ratio. Of two scopes with the same ratio, the one reported (the panel's "island 0" or "island 1") followed the set's order, which follows the string hashes and so PYTHONHASHSEED. The keys are now walked in sorted order. 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.
Summary
Product bug in the dashboard's breaker panel. Results depended on the process's hash seed.
BreakerState.drop_ratesreports, for each data-dropping guard, the scope with theworst drop ratio. It walked a
setof(entry, scope)keys and kept the first scopewith the worst ratio. When two scopes have the same ratio, the scope it names follows
the set's iteration order. That order follows the string hashes, so it changes with
PYTHONHASHSEED. With thedilocofixture,breakers.layers[0].rows[2].acted.rate.scopewas
island 0in some processes andisland 1in others.Fix
The keys are walked in sorted order. Of two scopes with the same ratio the first in
that order is named (
island 0beforeisland 1). Ratios, counts and which entriesare reported are unchanged.
Impact
yeto/dashboard/breakers.py). No training, launch or plan code. Thecustomer gate below is identical to main.
yeto dashboardand an exported page of the same tapes could name different islands.iterations in the panel do not depend on the hash seed (checked: the other set walk,
in
_rows, only fills a dict whose rows are sorted by name afterwards).Verification
test_two_islands_with_the_same_drop_rate_name_the_same_island_under_any_hash_seed:two islands with the same drop ratio are reduced in 8 processes with
PYTHONHASHSEED0 to 7. On main they name{island 0, island 1}; with this change,always
island 0.dilocofixture withPYTHONHASHSEED0 to 3:island 0every time.tests/test_dashboard*.pyandtests/test_breakers*.py: 1187 passed, 2 skipped.examples/k31dry-runs (run up --dry-runof both run configs with their preflight logs, and the pool
--dry-run) are identicalline by line to origin/main after normalization.
🤖 Generated with Claude Code