RELIABILITY · LIVE EXPERIMENT
Circuit breaker: in-flight capacity
Break a dependency, watch the gate protect it, and decide when traffic can safely return.
0 requests generated · 0 recovery probes
Your experiment
Increase traffic and response time. Observe in-flight requests before the breaker opens and why they still finish afterward.
- Run the scheduled outage and inspect the state history.
- Pause, change one control, and step forward.
- Compare a second run using the same seeded traffic.
Successes + dependency failures + fast rejections + in-flight requests must equal requests generated.
Decision trace
Model assumptions: one shared breaker, consecutive-failure trip threshold, fixed response time, one half-open probe, and one successful probe to close. No retries or production network calls. Scheduled outage runs from 8s to 30s; changing the error rate switches to manual control. Rejected requests are not successful responses. Pattern reference.
Measure the work already admitted
An open circuit stops new attempts; it does not cancel requests that already reached the dependency. This lesson separates generated requests, successful responses, failed responses, fail-fast rejections and pending work. At every recorded instant, generated equals successes plus failures plus rejections plus pending. The diagram animates these same request records. Its ninety-second timeline is a deterministic simulation, not a benchmark of an A2A transport or Java executor. No network request or real agent runs. Use the pending count to reason about resources still occupied after a failure has been detected.
Work an exact capacity boundary
Choose Healthy, set Requests per second to 10, Response time to 1 second and Consecutive failures to open to 3. Choose Break service at time zero, press Restart to retain the manual scenario and advance two seconds. Scrub recorded time to 1.30 seconds. Thirteen requests have been generated: three failures have completed, nine requests remain pending and one request is rejected. The first request arrived at 0.10 seconds and completed at 1.10 seconds. The third failure completes at 1.30 seconds, opening the gate before the next arrival at that timestamp. Twelve attempts were admitted even though the threshold is only three. Threshold counts completed failures, not total work sent.
Change demand and latency separately
Requests per second controls the regular arrival rate. Response time sets the fixed delay captured when each attempt is admitted. Higher demand or longer delay can increase concurrent pending work before the gate opens. Changing latency does not retroactively alter existing requests. Dependency errors assigns a seeded probability at request creation; it does not redraw an outcome when a response arrives. Changing that control switches to a manual scenario. A successful response clears the consecutive-failure streak while CLOSED. The model has no queue limit, retry policy, timeout or bulkhead. A circuit breaker alone therefore cannot enforce a hard concurrency ceiling.
Inspect the recovery probe
Cooldown sets how long OPEN waits before HALF-OPEN permits one probe. Other requests fail fast while that probe is outstanding. A successful probe closes the circuit; a failed probe starts another cooldown. Responses admitted in an earlier state epoch still update the outcome totals but cannot close or reopen a newer epoch. This prevents a late old response from overruling the current probe. Repair service affects newly created requests; a probe already marked failed will still fail. With the worked one-second response scenario and a six-second cooldown, the first probe is admitted at 7.30 seconds and its response arrives at 8.30 seconds.
Separate presets, bypass and manual faults
Healthy resets the simulation with no scheduled failure. Outage plus recovery resets to a scheduled fault from second eight through just before second thirty, after which newly created requests are healthy. Both presets retain your other numerical controls. Break service and Repair service switch to manual failure or manual health without clearing counters. Enable circuit breaker controls protection: clearing it admits requests even while the dependency fails. It is useful for a comparison but is not a recovery mechanism. Changing cooldown during an existing OPEN interval affects a later opening; it does not rewrite the already assigned probe deadline.
Replay and compare recorded evidence
Play and Pause control the simulation. Restart clears history and counters while retaining settings and manual or scheduled mode. Step advances one simulation second and pauses. Speed adjusts playback pace; the visual clock is simulation time, and delayed browser frames can make playback take longer than wall time. The recorded-time slider can visit only states that have actually been generated. Resuming, stepping or changing a domain control after scrubbing creates a new branch and discards the later history. Capture baseline saves the current controls and caption; use the notebook to record the count identity and the exact time being compared. The scrollable diagram has a text caption, counters and event log, so the experiment does not require interpreting moving dots or color alone.