74
circuit breaker
Stop calling a dependency that is already failing. Fail fast, then try again later.
What is circuit breaker?
A circuit breaker counts failures to a dependency. Past a threshold it opens: calls fail immediately without waiting. After a cool-down it half-opens and lets one trial through. Closed means healthy.
Why does circuit breaker matter when vibe coding?
Models retry forever with no cap. One dead upstream then ties every request to a 30s timeout. Name the breaker, the threshold, and the fallback.
How do you do circuit breaker?
Timeouts first. Then a limit on retries. Then a breaker around the flaky client. When open, return a clear error or a stale cache — do not hang.
How do you ask a model for circuit breaker?
Put a circuit breaker around (client). Timeout each call. After (N) failures, fail fast. Half-open later. Do not retry forever. Do not wait on a dead upstream.
What goes wrong with circuit breaker?
A breaker that opens and never closes, so you “fixed” the outage by staying down. Half-open is the point.