recall

← recall

circuit breaker pattern

Stop hammering a failing dependency. Track recent failures; once they cross a threshold, fail fast for everyone instead of waiting for timeouts. Periodically test if the dependency is back, then close the circuit and resume.

Stop hammering a failing dependency. Track recent failures; once they cross a threshold, fail fast for everyone instead of waiting for timeouts. Periodically test if the dependency is back, then close the circuit and resume.

symptoms

  • calls to a downstream are timing out and stacking up threads
  • your service is slow because a dependency is
  • errors with no clear root cause keep coming back during partial outages

causes

  • downstream service degraded
  • no upstream isolation when a dependency fails

fixes

  • circuit breaker library (Resilience4j, Polly, Hystrix-style)
  • timeouts so the breaker has signal
  • fallback responses when open
  • tune thresholds to match downstream characteristics

you might say

  • circuit's open
  • we tripped the breaker
  • fail-fast for now

related

aliases: fail-fast, trip

topics: resilience

references: