Part 5 of 8 · 1 min read
When not to retry
Some failures will never get better.
A call that can be retried is not always a call that should be. UDS gives two rules.
- Do not retry errors that will not go away. If the failure is that the caller has no permission, a retry will fail again. Fail fast and cancel the call.
- Do not retry calls with side effects unless they are idempotent. A call to a payment provider times out. The payment may have gone through. A retry could charge the customer twice, unless the call is idempotent (Level 6, page 2): repeating it has the same effect as doing it once. The usual tool is an idempotency key sent with the request.
Common mistake
Retrying every error. A failure of "not authorised" or "bad request" will not change on the next try, and each retry adds load for no gain.
Check yourself: 1. Why is a timed-out payment call dangerous to retry? 2. Which kind of error should never be retried? 3. What makes a call safe to repeat?