AlgoViz

Failure handling and retry budgets

medium 4 min

Set an end-to-end deadline and decide which layer owns retries.

Video lesson · Chapter 1 of 5

Three callers multiply a failure

0:00 / 3:24

How one failed request becomes 27 calls

1:14Reel

Theory

Read or listen first. About 1 min.

What it is

Each attempt at a higher layer can trigger a fresh set of attempts below it. To find the load during a persistent failure, trace one incoming call all the way to the last dependency.

Count the calls reaching the last service

Gateway3Service9Dependency27Total calls at each layer during sustained failure3 × 3 × 3 = 27 downstream attempts
With three total attempts per layer, persistent failures can turn one request into 3 × 3 × 3 = 27 calls at the deepest dependency.

Why it exists

Backoff spreads attempts over time. An attempt budget also caps their number, so retries cannot consume the capacity needed for recovery.

Words to know

Attempt budget
The maximum number of calls, including the first, allowed for one logical operation.

How it works

Step through the idea, or press Play.

Step 1 of 3

Set a deadline. Reserve time for downstream work and the return path.

Understand it

Worked example

Failure handling and retry budgets in practice

Three nested services each allow three attempts. One incoming operation can produce up to 27 attempts at the deepest dependency. A single retry owner makes amplification easier to bound.

Related case

A transfer crosses two shards

An allocation moves credits between two accounts on different shards. The coordinator loses its response after asking the participants to commit.

Follow transfer T17
Move 40 credits with receipt T17Shard A100 creditsT17openedShard B0 creditsStart with 100 credits in total

Check the original transaction identity.

Sources