FFORGE//RS
← Roadmap

distributed systems / LEVEL 4

The stale success that closed the circuit

EST.50 MIN
01

THEORY / RETRIEVAL

What to restore

  • Model Closed, Open and HalfOpen as explicit mutually exclusive states
  • Define the exact cooldown boundary and admit one HalfOpen probe
  • Fence completions from older breaker generations
  • Keep logical time monotonic without arithmetic wraparound

The three states protect different boundaries

Closed admits ordinary work and counts consecutive failures. Reaching the threshold opens the circuit so calls fail fast instead of amplifying an unhealthy dependency. After the cooldown, HalfOpen admits one controlled probe: success closes the circuit and failure starts a new open interval. A probe stampede defeats the recovery boundary.

A completion belongs to the generation that admitted it

Requests already in flight when a circuit opens may finish much later. Without a generation token, an old success can close a newer Open cycle or an old failure can reopen a recovered circuit. A move-only permit carries the admission generation, and record consumes it so stale completions become explicit no-ops.

Circuit breakers do not replace neighboring controls

A breaker estimates dependency health from recent outcomes. Timeouts bound one attempt, retry budgets bound amplification, rate limiters control admission and bulkheads isolate capacity. Production systems compose these controls and define which failures count; the exercise isolates the state-machine contract so every transition is deterministic.

CHECKPOINT

Which two properties prevent both a recovery stampede and a late result from corrupting a newer circuit-breaker cycle?

Select every applicable option. Credit requires an exact set match.

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / DEBUGGING

Find and fix the defect

Repair the circuit breaker without changing its public API. Closed must open at the exact failure threshold; Open must admit exactly one probe at the exact cooldown boundary; failed probes reopen from their completion time; and stale permits must be ignored before they can advance logical time or mutate a newer generation.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
4 / 64 KB
OUTPUT
Runner is waiting for a submission.