← ClaudeAtlas

circuit-breakerslisted

The breaker as a state machine that stops calling a failing dependency: closed, open and half-open; choosing rate windows versus consecutive failures; why half-open admits a bounded number of probes; the failure predicate—classifying correlated dependency failures rather than blindly counting status classes—and the distinction between protecting caller resources by failing fast and providing a semantically valid fallback. Use when a breaker trips on consecutive failures, when it never trips or trips on one client's bad requests, when half-open sends full traffic at a recovering dependency, when a breaker sits on a call with no timeout under it, or when a dependency is slow rather than failing. Does not cover bulkheads (concurrency-limiting-and-bulkheads), retry policy (retries-and-backoff), the bound itself (timeouts-and-deadlines), the system-wide loop (cascading-failures), shedding (rate-limiting-and-load-shedding), or serving a cached fallback (caching-strategies).
robsonkades/agent-skills · ★ 2 · Web & Frontend · score 75
Install: claude install-skill robsonkades/agent-skills
# Circuit Breakers ## Purpose A circuit breaker is a state machine in the caller that stops calling a dependency which is already failing, so calls fail immediately instead of waiting for a timeout. It avoids tying up additional caller threads and connections in calls predicted to fail — the amplification point `cascading-failures` names as pool exhaustion. **A breaker fails fast on rejected calls; it does not supply a successful result for them.** That protects the caller's resources even when the only honest result is a typed error. A fallback or degraded response can preserve useful availability, but is not a prerequisite for resource protection. Decide both the fast-failure contract and any fallback first. ## States ```text CLOSED → OPEN failure rate or slow-call rate ≥ threshold, over ≥ minimum calls OPEN → HALF_OPEN after the wait duration; calls before it are rejected untried HALF_OPEN → CLOSED the configured probe sample meets success/slow-call thresholds HALF_OPEN → OPEN the completed probe sample breaches a threshold (per implementation policy) ``` ## Workflow The Java illustration requires Java 21+ without preview; configuration guidance is checked against Resilience4j 2.3.0 and its CircuitBreaker guide. Inspect compiler release/toolchain, runtime image, resolved breaker/client dependencies and Spring/programmatic integration before using property names or decorators. Do not upgrade the project to adopt this example. Without per-inst