Course menuDVA-C03

Exams / DVA-C03 / SDKs, retries and error handling / Question 1

DVA-C03 practice question: SDKs, retries and error handling (1 of 2)

Development with AWS Services A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A photo-tagging service runs 300 workers that call an AWS API at the same time.

During busy periods many of the calls fail with ThrottlingException. The batch must finish before the morning publishing run, so the calls cannot simply be dropped. The developer is writing custom retry code around one of these calls.

Which approach does AWS recommend for retrying the call?

Choose one answer.

  1. A. Retry straight away in a tight loop until the call succeeds.
  2. B. Retry after a fixed one-second delay, with no limit on how many attempts are made.
  3. C. Retry with exponential backoff and random jitter, up to a fixed maximum number of attempts.
  4. D. Treat ThrottlingException as a permanent error and fail the job straight away, so the workers stop sending requests.
Show the answer and explanation

Answer: C

  • A. Wrong: Immediate retries add load to a service that is already throttling, which makes the problem worse. Retries should wait before they are sent.
  • B. Wrong: A fixed delay keeps every worker retrying at the same moments, and with no limit a call could retry forever.
  • C. Right: Correct. Growing delays ease the pressure on the service, random jitter spreads out the retries from many workers, and a maximum stops endless retrying. Learn more: Retry behavior in the AWS SDKs (opens in a new tab)
  • D. Wrong: Throttling is a transient error that the SDKs retry. Failing at once gives up on requests that would have succeeded a moment later.

Explanation

AWS recommends exponential backoff with jitter for throttling errors. The growing wait reduces the load on the service, the random element stops many workers retrying together, and a limit on attempts keeps the job from retrying forever.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on SDKs, retries and error handling? The 5 full-length practice sets have 10 more SDKs, retries and error handling questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets