AWS Certified DevOps Engineer - Professional free question 8 / 10 · Domain 5: Incident and Event Response
A Task state calls a Lambda function that fails now and then with transient errors. The team wants exactly four retries, the first after 2 seconds and each following wait twice as long as the previous one. Which retrier fits?
- IntervalSeconds 2, BackoffRate 1 and MaxAttempts 4, which produces four waits of 2 seconds
- IntervalSeconds 2, BackoffRate 2 and MaxAttempts 4, which produces waits of 2, 4, 8 and 16 seconds
- IntervalSeconds 2, BackoffRate 2 and MaxAttempts 3, which produces waits of 2, 4 and 8 seconds
- IntervalSeconds 4, BackoffRate 2 and MaxAttempts 4, which produces waits of 4, 8, 16 and 32 seconds
Show the answer and explanation
Answer: B
Why this is correct
A retrier in the Retry field of a Task, Parallel or Map state sets the wait before the first retry with IntervalSeconds, the multiplier for each later wait with BackoffRate, and the maximum number of retries with MaxAttempts. Starting at 2 seconds and doubling gives 2, 4, 8 and 16 seconds, and four attempts stop after the 16 second wait.
Why the other options are wrong
"IntervalSeconds 2, BackoffRate 2 and MaxAttempts 3, which produces waits of 2, 4 and 8 seconds" … MaxAttempts is the maximum number of retry attempts. A value of 3 stops after the 8 second wait, one retry short of the four that the team wants.
"IntervalSeconds 2, BackoffRate 1 and MaxAttempts 4, which produces four waits of 2 seconds" … BackoffRate is the multiplier by which the retry interval increases after each attempt. A value of 1 keeps the wait at the same length for every retry.
"IntervalSeconds 4, BackoffRate 2 and MaxAttempts 4, which produces waits of 4, 8, 16 and 32 seconds" … IntervalSeconds is the number of seconds before the first retry attempt, so a value of 4 starts the sequence at 4 seconds instead of 2.
Key points
IntervalSeconds is the first wait, BackoffRate multiplies it per retry, and MaxAttempts caps the number of retries.