'Exponential backoff for AWS Lambda Asynchronous Invocation

AWS Lambda's Asynchronous Invocation page states that

For throttling errors (429) and system errors (500-series), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes.

I'm trying to understand what "The retry interval increases exponentially" means exactly. Does it go from 1 second to 3, to 7? I'm unable to find any specific information on this anywhere on Lambda information pages.



Solution 1:[1]

The idea behind an exponential backoff (with retry) is that the retry interval increases exponentially between retries after each failure.

In this case, the documentation is just specifying the minimum and maximum for the retry interval. This means that the initial retry delay is 1 second and the maximum retry delay is 5 minutes.

The retry delay will not be increasing beyond 5 minutes regardless of if Lambda failures are still occuring.

Something like the below, is how this works:

1. Try to process request
2. Request returns 429 or 5xx
3. Wait 1 second
4. Retry
5. Request returns 429 or 5xx
6. Wait 2 seconds
7. Request returns 429 or 5xx
...
43. Wait 5 minutes
44. Request returns 429 or 5xx
45. Wait 5 minutes

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ermiya Eskandary