Skip to content

feat(hybridcloud): Add read-only state() to the RPC circuit breaker - #129330

Merged
valencitas merged 2 commits into
masterfrom
sarahwalker/ctrl-93-rpc-circuit-breaker-state
Nov 3, 2026
Merged

valencitas merged 2 commits into
masterfrom
sarahwalker/ctrl-93-rpc-circuit-breaker-state

Conversation

@valencitas

@valencitas valencitas commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Add a read-only state() to RpcCircuitBreaker that returns a destination's breaker state, seconds left in that state, and error/total counts for the current window.

Why

We want to test the new circuit breaker is working as expected via a job runner script. Right now there is no public way for the job to know the state of the breaker, so this adds a small read-only state() method. It changes nothing about how the breaker behaves.

Lets operators read a destination breaker's state, time left in state, and
window counts without reaching into circuit_breaker2 internals. Needed by the
CTRL-93 fire drill job.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown

CTRL-93

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 30, 2026
@valencitas
valencitas marked this pull request as ready for review October 30, 2026 18:29
@valencitas
valencitas requested a review from a team as a code owner October 30, 2026 18:29
@valencitas
valencitas merged commit 56e837a into master Nov 3, 2026
69 checks passed
@valencitas
valencitas deleted the sarahwalker/ctrl-93-rpc-circuit-breaker-state branch November 3, 2026 15:32
joshuarli added a commit that referenced this pull request Nov 3, 2026
`backend typing` is red on master. It first failed on 56e837a
(#129330), but that commit isn't the cause.

The cause is #129322, which added six unannotated test methods to
`test_organization_pull_request_files.py`. It merged after strict mypy
was turned on in #129614, so the two PRs raced and CI started reporting
`no-untyped-def` on master.

This adds `MagicMock` / `-> None` annotations to those methods, the same
way the rest of the file already does it. Only type hints change. Test
behavior stays the same.

<!-- junior-request-attribution:start -->
via @joshuarli.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0BQC9WSQ2E%3A1793720276.363209 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0BQC9WSQ2E%3A1793720276.363209)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0BQC9WSQ2E%3A1793720276.363209/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Joshua Li <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 15ee9d6c Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants