<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="830" viewBox="0 0 960 830" role="img" aria-labelledby="title desc">
<style data-site-theme="n3wth">
  [fill="#6e6e73"] { fill: #6e6e73; }
  [fill="#f5f5f7"] { fill: #f5f5f7; }
  [fill="#1d1d1f"] { fill: #1d1d1f; }
  [fill="#fff"] { fill: #ffffff; }
  [stroke="#c7c7cc"] { stroke: rgba(8, 9, 11, 0.2); }
  [fill="#0a5c22"] { fill: #0a5c22; }
  [fill="#8a1006"] { fill: #8a1006; }
  [stroke="#6e6e73"] { stroke: #6e6e73; }
  [fill="#0071a4"] { fill: #054a6b; }
@media (prefers-color-scheme: dark) {
  [fill="#6e6e73"] { fill: #9aa0a8; }
  [fill="#f5f5f7"] { fill: #08090b; }
  [fill="#1d1d1f"] { fill: #f2f3f5; }
  [fill="#fff"] { fill: #0d0e10; }
  [stroke="#c7c7cc"] { stroke: rgba(255, 255, 255, 0.17); }
  [fill="#0a5c22"] { fill: #8ef2ab; }
  [fill="#8a1006"] { fill: #ffb3ae; }
  [stroke="#6e6e73"] { stroke: #9aa0a8; }
  [fill="#0071a4"] { fill: #a9e5ff; }
}
</style>
<title id="title">Fail fast while a dependency recovers</title><desc id="desc">Closed permits calls until a failure threshold opens the circuit. Open rejects calls. After a reset timeout, half-open permits a trial; success returns to closed and failure returns to open and restarts the timeout.</desc>
<defs><marker id="arrow" markerWidth="9" markerHeight="9" refX="8" refY="4.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M0 0L9 4.5L0 9Z" fill="#6e6e73"/></marker></defs>
<rect width="960" height="830" fill="#f5f5f7"/><g font-family="system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"><text x="40" y="59" font-size="36" font-weight="600" fill="#1d1d1f" text-anchor="start"><tspan x="40" dy="0">Fail fast while a dependency recovers</tspan></text><text x="40" y="98" font-size="24" font-weight="400" fill="#6e6e73" text-anchor="start"><tspan x="40" dy="0">A simplified circuit-breaker state machine</tspan></text><rect x="40" y="154" width="370" height="160" rx="0" fill="#fff" stroke="#c7c7cc" stroke-width="2"/><text x="62" y="192" font-size="28" font-weight="600" fill="#0a5c22" text-anchor="start"><tspan x="62" dy="0">Closed</tspan></text><text x="62" y="232" font-size="25" font-weight="400" fill="#1d1d1f" text-anchor="start"><tspan x="62" dy="0">Let calls reach</tspan><tspan x="62" dy="32.5">the dependency.</tspan></text><rect x="550" y="154" width="370" height="160" rx="0" fill="#fff" stroke="#c7c7cc" stroke-width="2"/><text x="572" y="192" font-size="28" font-weight="600" fill="#8a1006" text-anchor="start"><tspan x="572" dy="0">Open</tspan></text><text x="572" y="232" font-size="25" font-weight="400" fill="#1d1d1f" text-anchor="start"><tspan x="572" dy="0">Reject calls without</tspan><tspan x="572" dy="32.5">calling the dependency.</tspan></text><path d="M410 227H537" fill="none" stroke="#6e6e73" stroke-width="3" marker-end="url(#arrow)"/><text x="480" y="164" font-size="23" font-weight="600" fill="#6e6e73" text-anchor="middle"><tspan x="480" dy="0">Failure</tspan><tspan x="480" dy="29.900000000000002">threshold</tspan></text><rect x="290" y="506" width="380" height="160" rx="0" fill="#fff" stroke="#c7c7cc" stroke-width="2"/><text x="312" y="544" font-size="28" font-weight="600" fill="#0071a4" text-anchor="start"><tspan x="312" dy="0">Half-open</tspan></text><text x="312" y="584" font-size="25" font-weight="400" fill="#1d1d1f" text-anchor="start"><tspan x="312" dy="0">Allow a trial call</tspan><tspan x="312" dy="32.5">to check for recovery.</tspan></text><path d="M735 314V413H585V493" fill="none" stroke="#6e6e73" stroke-width="3" marker-end="url(#arrow)"/><text x="760" y="373" font-size="24" font-weight="400" fill="#6e6e73" text-anchor="start"><tspan x="760" dy="0">Reset</tspan><tspan x="760" dy="31.200000000000003">timeout</tspan></text><path d="M290 586H154V327" fill="none" stroke="#6e6e73" stroke-width="3" marker-end="url(#arrow)"/><text x="50" y="405" font-size="24" font-weight="400" fill="#6e6e73" text-anchor="start"><tspan x="50" dy="0">Trial</tspan><tspan x="50" dy="31.200000000000003">succeeds</tspan></text><path d="M670 586H872V328" fill="none" stroke="#6e6e73" stroke-width="3" marker-end="url(#arrow)"/><text x="715" y="545" font-size="24" font-weight="400" fill="#6e6e73" text-anchor="start"><tspan x="715" dy="0">Trial fails:</tspan><tspan x="715" dy="31.200000000000003">restart timer</tspan></text><text x="40" y="731" font-size="26" font-weight="400" fill="#1d1d1f" text-anchor="start"><tspan x="40" dy="0">Choose thresholds for the dependency; none are universal.</tspan></text><path d="M40 768H920" fill="none" stroke="#c7c7cc" stroke-width="3"/><text x="40" y="802" font-size="22" font-weight="400" fill="#6e6e73" text-anchor="start"><tspan x="40" dy="0">Conceptual illustration • not measured data</tspan></text></g></svg>
