A circuit breaker stops sending some calls to a failing dependency after a local threshold is crossed. Its state may differ across client replicas; one instance opening does not establish a fleet-wide decision. Recovery requires a limited trial path, often called half-open, before normal traffic resumes. A cached fallback can preserve part of the user experience but must not be counted as a successful live dependency call.
Circuit breaker recovery: probe capacity without reopening a flood
Operational decision
A fraud-check dependency begins timing out. Bound pending requests and open the breaker when recent failures cross a tested threshold; reject or use a labeled fallback according to business policy. Once the cool-down ends, admit a small number of trial calls per client instance and cap their aggregate rate at the dependency's recovering capacity. The policy block is illustrative; reconcile it with the actual proxy or client implementation. Only real dependency responses count as probe successes. Gradually restore live traffic while watching provider latency, failure rate, pending requests, and fallback fraction. If probes fail, reopen and lengthen the next interval within a bounded policy. Test a partial failure where only one endpoint is bad, since a cluster-wide breaker may sacrifice healthy capacity. Record whether a fraud decision was skipped, delayed, or rejected; a green HTTP status from fallback does not mean equivalent protection was applied.
Fraud-check breaker policy
Open on: tested failure-rate and minimum-sample condition
While open: labeled fallback or explicit rejection
Recovery: at most 2 trial calls per client instance
Probe success: live fraud response only
Reopen: failed trial or growing pending-request queue
Audit field: decision_source=live|fallback|rejectedCost and verification
Small trial batches slow recovery but avoid swamping a fragile service. Many client instances each admitting trials can collectively create a large probe burst; cap the fleet total or coordinate when needed. A fallback may add business risk and stale-data cost. Keep breaker-open duration, pending queue, probe success, and true live-decision share visible. Do not make a breaker the only overload control when the caller can still allocate unbounded waiting work.
Common Mistakes
- Do not call fallback responses proof that the dependency recovered.
- Do not assume a per-instance probe limit is a fleet-wide limit.
- Do not omit a minimum sample size before opening on a failure percentage.
Connected lessons
- DevOps: delivery, infrastructure, and reliable operations
- Retries and timeouts: bound the cost of a failed request
- Overload shedding: refuse excess work before latency collapses
- Synthetic transactions: measure the route a user actually takes
- Observability: join metrics, logs, and traces
