Pcornel
Automation · Error Handling

Circuit Breaker

Cheat sheet · https://pcornel.dk/topic.php?topic=5979

Back to the Topic

Answer

A circuit breaker stops calling a failing dependency after repeated errors, fails fast for a cooling-off period, then tries again, protecting both the automation and the failing service.

Remember

  • Open after repeated failures.
  • Fail fast while open.
  • Half-open to test recovery.

First checks

  • Circuit breaker state (closed/open/half-open) — protection
  • Failure threshold and reset time — configuration
  • Fallback behaviour — degradation

Verify in this order

failures exceed threshold → open → probe → close

Where it usually breaks

Commit/input → runner/job → build/test artifact → deployment request → target rollout/reconcile → effective version/config → health/readiness → workload.

Error Handling → Circuit Breaker · operational reference

LayerError Handling → Circuit Breaker operational reference
Runtime/ownershipdistributed automation resilience / circuit breaker pattern · the client-side or middleware circuit-breaker state machine protecting a remote dependency
Persistent intentpolicy defining failure classifications, rolling threshold, open duration, half-open probe count and fallback behavior
VerificationInject controlled dependency failures until the threshold is crossed, observe CLOSED→OPEN→HALF-OPEN transitions, then restore the dependency and verify limited probes return the breaker to CLOSED.
Expected interpretationThe breaker trips only on configured failure classes, fast-fails while OPEN, limits recovery probes, exposes state transitions, and returns to CLOSED only after the defined success criteria.
Recovery boundarypreserve transition metrics and representative errors, repair the failing dependency or classification, allow controlled half-open probes, then verify CLOSED only after successful bounded calls

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5979

Confirmation

Confirm action

Continue?