THE FOLD / RESPAWN / SECOND WIND / THE CIRCUIT BREAKER
THE CIRCUIT BREAKER
a dependency outage converted into your own, deliberately
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
If a dependency has failed the last five times, the sixth call is not a request — it is a guess with a timeout attached. A circuit breaker stops guessing and checks back occasionally instead.
LIT verified live. A 2,000-tick outage inside a 6,000-tick run. Without a breaker: 6,000 calls, 2,000 failures — every single request during the outage waits for a timeout. With a breaker that opens after 5 consecutive failures and probes every 200 ticks: 14 failures and 1,990 rejected immediately. That is 1,986 wasted calls avoided, a 99.3% reduction, at the cost of 10 probe calls to notice the recovery.
LIT verified live. A 2,000-tick outage inside a 6,000-tick run. Without a breaker: 6,000 calls, 2,000 failures — every single request during the outage waits for a timeout. With a breaker that opens after 5 consecutive failures and probes every 200 ticks: 14 failures and 1,990 rejected immediately. That is 1,986 wasted calls avoided, a 99.3% reduction, at the cost of 10 probe calls to notice the recovery.
2 HOW IT WAS WEAVED · AI + HUMAN
The pattern is Michael Nygard’s, from Release It!; the half-open state is the part that makes it a breaker rather than a fuse.
AVAN (AI) counted the probes as well as the savings, because the probe interval is the real design parameter. 10 probes across the outage is what buys the recovery detection, and shortening the interval to notice faster is precisely what turns the breaker back into the retry storm it was installed to stop.
AVAN (AI) counted the probes as well as the savings, because the probe interval is the real design parameter. 10 probes across the outage is what buys the recovery detection, and shortening the interval to notice faster is precisely what turns the breaker back into the retry storm it was installed to stop.
3 ONE DIMENSION
The run, with and without a breaker.
4 TWO DIMENSIONS · INTERACTIVE
Tune the probe interval and the trip threshold.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: a door that closes itself.
AVAN’s addition (the inverse-companion): the forward reading is that a breaker protects you from a failing dependency. The inverse is that it fails your requests on the dependency’s behalf, using stale evidence. Once open it rejects calls that might have succeeded, based on what was true two hundred ticks ago, and every rejection is a decision made without asking. Read backwards, a breaker converts a dependency’s outage into your own deliberate outage — faster, cheaper, and entirely your responsibility.
LIT a 2,000-tick outage inside a 6,000-tick run costs 6,000 calls and 2,000 failures without a breaker, while a breaker opening after 5 consecutive failures and probing every 200 ticks gives 14 failures and 1,990 immediate rejections - 1,986 wasted calls avoided, a 99.3% reduction, at the cost of 10 probe calls to notice the recovery
FIG The pattern is Michael Nygard's, from Release It!; the half-open state is what makes it a breaker rather than a fuse. AVAN counted the probes as well as the savings, because the probe interval is the real design parameter. 10 probes across the outage is what buys the recovery detection, and shortening the interval to notice faster is precisely what turns the breaker back into the retry storm it was installed to stop.
FIG The pattern is Michael Nygard's, from Release It!; the half-open state is what makes it a breaker rather than a fuse. AVAN counted the probes as well as the savings, because the probe interval is the real design parameter. 10 probes across the outage is what buys the recovery detection, and shortening the interval to notice faster is precisely what turns the breaker back into the retry storm it was installed to stop.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SECOND WIND · David Lee Wise (ROOT0), with AVAN