Circuit breaker.
also: circuit breakers · circuit-breaker · circuit breakingA wrapper around calls to a dependency that stops calling it after repeated failures, fails fast, then cautiously probes for recovery.
the two-minute refresher
- Like an electrical breaker: trip before the whole house burns.
- CLOSED: calls pass, failures are counted. Past the threshold → OPEN.
- OPEN: calls are rejected instantly without touching the dependency. After a timeout → HALF-OPEN.
- It protects your threads and gives the failing service room to recover.
- Count timeouts, 5xx and connection errors as failures, not 4xx or business errors.