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
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.