Bounded Retries When a Dependency Is Slow

Retrying consumes capacity and remaining time. Limit attempts and choose when a retry is permitted under the operation's semantics.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a traffic increase
  2. Use both a time and an effect contract
  3. Count the scheduled attempts within time
  4. Check how retries contribute to load

Trace a traffic increase

If every original request makes two more attempts during a delay, the dependency can see up to three times the submitted work. The attempt count defines that multiplier.

Use both a time and an effect contract

A request already near its deadline may have no useful time for another attempt. A write with a lost response needs an appropriate repeat policy. See retry deadlines.[1]

Count the scheduled attempts within time

With a 400-millisecond total deadline, an initial call lasting 180 and a planned delay of 50 leave 170 for any retry and response work. If the next delay would exhaust the budget, finishing with a useful failure is the defined outcome. See retry budgets for loops.

Start: 400 ms budget
First call uses 180 ms
Delay uses 50 ms
Remaining: 170 ms before reserving other work

Check how retries contribute to load

Many callers repeating promptly can add pressure to a slow dependency. Use bounded scheduling under agreed retry rules and only retry safe operations. Test an immediate permanent error and one recoverable delay.

References

  1. Google, Site Reliability Engineering ↩