Bird
0
0

You wrote a retry loop for DynamoDB but it never stops retrying even after 5 attempts. What is the most likely cause?

medium📝 Debug Q6 of 15
DynamoDB - with AWS SDK
You wrote a retry loop for DynamoDB but it never stops retrying even after 5 attempts. What is the most likely cause?
AThe exception is not caught properly
BThe retry count variable is not incremented inside the loop
CThe DynamoDB client automatically retries infinitely
DThe loop condition uses retry_count > 5 instead of < 5
Step-by-Step Solution
Solution:
  1. Step 1: Check retry count increment logic

    If retry_count is never increased, loop condition never fails.
  2. Step 2: Confirm loop behavior

    Without increment, retry_count stays same, causing infinite retries.
  3. Final Answer:

    The retry count variable is not incremented inside the loop -> Option B
  4. Quick Check:

    Missing increment causes infinite retry loop [OK]
Quick Trick: Always increment retry count inside retry loop [OK]
Common Mistakes:
MISTAKES
  • Forgetting to increment retry count
  • Catching wrong exception type
  • Using incorrect loop condition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes