fix: fail closed when live broker state is unreadable - #59
Closed
albertovincenzi wants to merge 1 commit into
Closed
fix: fail closed when live broker state is unreadable#59albertovincenzi wants to merge 1 commit into
albertovincenzi wants to merge 1 commit into
Conversation
This was referenced Sep 5, 2026
Contributor
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.
Problem
Every live-state read used unwrap_or_default or ok, turning a broker/KV failure into valid-looking empty data. During an outage Gate could report counters at zero, no held breaker, state flowing, and an immediate ETA even though the source of truth never answered.
This affected graph detail, target lists, shared-budget views, product metrics, ETA, and recent breaches. A 200 response was therefore indistinguishable from a real unused budget.
Fix
Verification
A broker-backed live test blocks the KV surface and checks graph detail, ETA, target list, shared budgets, recent breaches, and product metrics. Every endpoint must return 502 instead of a zero/empty 200.
Review / dependency
This PR is stacked on #58 because breaker reads become fallible after the record validation is centralized there. Review commit 91b69aa relative to fix/validate-breaker-records. Merge order: #44, #58, then this PR.
#30 independently bounds the recent-breaches limit and touches one nearby line; after #30 merges this branch needs only a mechanical one-line rebase preserving both changes.