Three states
- Closed (normal operation) — requests flow through. Failure counter increments on errors
- Open (breaker tripped) — requests are blocked; fallback is returned immediately. Set when failures exceed the threshold
- Half-Open (probing) — after a timeout, one test request is let through. If it succeeds → Closed; if not → back to Open
Why
Without a circuit breaker: slow service A → threads in service B hang waiting → service B exhausts its thread pool → the entire cluster fails. The circuit breaker "disconnects" service A and lets the rest of the system continue operating.