Complete the code to set the initial retry delay.
retryDelay = [1]The initial retry delay is usually set in milliseconds, here 1000ms means 1 second.
Complete the code to calculate the next retry delay using exponential backoff.
nextDelay = retryDelay * (2 [1] attempt)
Exponential backoff multiplies the delay by 2 to the power of the attempt number.
Fix the error in the retry condition to stop after max attempts.
if attempt [1] maxAttempts: stopRetrying()
The retry should stop when the attempt count is greater than or equal to the max allowed attempts.
Fill both blanks to implement jitter in the retry delay calculation.
import random jitter = random.[1](0, retryDelay) nextDelay = retryDelay [2] jitter
Jitter adds randomness to the delay to avoid retry storms. randint generates a random integer, and '+' adds it to the base delay.
Fill all three blanks to implement a capped exponential backoff with jitter.
maxDelay = 30000 baseDelay = 1000 attempt = 3 rawDelay = baseDelay * (2 [1] attempt) cappedDelay = min(rawDelay, [2]) jitter = random.[3](0, cappedDelay) finalDelay = cappedDelay + jitter
The delay grows exponentially with '**', is capped by maxDelay, and jitter is added using randint.