ai newsFr., 4. Dez.
EilmeldungAlibaba Releases Qwen4-35B-A3B: Open-Weight MoE Model With 1M Context

Claude API retry storms explained with a CCDV-P practice question

Picture a support agent on a Friday evening. Its Claude API requests get 529 responses for two minutes. The API recovers, but your workers keep sending three times their normal traffic for another fifteen. Incoming customer traffic is flat. Almost all of the extra work is retries. I use this fictio

dev.toFreitag 11:17 · 04.12.2 Min. Lesezeit
Bild: dev.to

Posted on Dec 4 • Edited on Dec 4 • AI-assisted

Picture a support agent on a Friday evening. Its Claude API requests get 529 responses for two minutes. The API recovers, but your workers keep sending three times their normal traffic for another fifteen. Incoming customer traffic is flat. Almost all of the extra work is retries.

I use this fictional incident to teach a production reliability decision for the Claude Certified Developer Professional (CCDV-P) exam. If you see three retry loops in the trace, count how many attempts one customer request can turn into.

Suppose your API client, agent runner and queue worker each make up to three total attempts when a retryable failure keeps propagating. An unlucky request can make up to 27 calls to the API. Each layer sees at most three attempts of its own. The service sees their product.

Check actual attempt counts before making a change. Look at SDK defaults and worker redelivery, then group downstream calls by original request. If one SDK call already retries, an extra outer loop may multiply its work. A rising queue age after upstream recovery is a clue that old attempts are crowding out new work.

Assign one layer to own retries for the API call. Give it a bounded number of attempts, a deadline, and backoff with jitter so workers do not wake up together. Check the Claude API error documentation for the failure you actually observed. A retry policy for temporary overload does not repair malformed input or a permission error.

Queue redelivery still matters. When a job crashes halfway through a workflow, resume or deduplicate at the job boundary. A timeout after a write leaves its outcome uncertain. If the agent can issue a refund, use a stable operation ID and a payment operation that deduplicates it, or reconcile the original result before trying again. Repeating the language model request and repeating the refund are two different decisions.

Your trace shows retries in the client, the agent runner and the worker. Success rates recover upstream after two minutes. Your old jobs still dominate the queue fifteen minutes later. Which change most directly reduces the load your own system creates during the next incident?

B. The trace tells you where the extra load comes from. Removing nested retry policies cuts the number of attempts one job can generate. A longer timeout holds work longer. A dashboard can make the issue visible. More workers can send the same retries upstream faster.

You can use the same exercise to test your own architecture. Trace a single request through an overload response, then through a timeout after a side effect. For each trace, write down who can retry, the maximum number of attempts, and how the system can tell whether a write already happened.

This article was prepared with AI assistance, including drafting and research. The API details were checked against Anthropic’s documentation.

Quelle: dev.to (dev.to). Original öffnen