The Research Report
Failure-Class Routing: Why One Retry Policy Makes LLM Agent Pipelines Self-Amplify Outages
date: 2026-11-08
title: "Failure-Class Routing: Why One Retry Policy Makes LLM Agent Pipelines Self-Amplify Outages"
author: Brian Taylor
Failure-Class Routing: Why One Retry Policy Makes LLM Agent Pipelines Self-Amplify Outages
Brian's pipeline articles so far cover when/how hard to retry (jittered backoff) and how to order durable writes (outbox + checkpoint commit). This one covers whether to retry at all: why a single @retry with one exception handler misclassifies LLM failures and turns a short provider blip into a self-sustaining retry storm. The shift: classify first, then route.
The problem: one retry policy over LLM failures does everything wrong
A six-agent research pipeline had 529s (Anthropic's provider-wide overload code) for 3 minutes after a model upgrade. Exponential backoff did exactly what it was meant to, and the pipeline did not recover until 32 minutes later. Why: every client backed off on the same schedule (2s, 4s, 8s, 16s), so the fleet retried in a synchronised wave that re-overloaded the provider the instant it recovered. The retries were not recovering from the overload - they were the overload. Meanwhile a tenacity decorator wrapped a model SDK that already retries twice, so one logical call became up to 18 real attempts. The morning's cost was roughly 4× normal, mostly burned on guaranteed failures.
The deeper issue is structural. The standard resilience playbook assumes four load-bearing things about failures (Mark Brooker's framing): they are transient, statistically independent across clients, cheap and fast to retry, and the operations are idempotent. LLM calls break all four:
- A 429 is not an independent failure. It means you hit your token-per-minute ceiling; a 529 means the provider is shedding load for everyone. When one agent is rate-limited, the others are about to be. Independent-failure math does not apply to a shared constraint.
- Retries are not cheap. A retried RPC costs 50ms. A retried LLM call costs seconds of wall-clock and real money per input token. Millisecond-tuned backoff schedules are meaningless.
- Retries are not idempotent. A retried TCP segment is free and identical. A retried generation that already streamed 3000 tokens re-bills the whole thing and may produce a different answer.
Brooker's sharp point: adding retries lowers day-to-day error rate while making the system far more likely to convert a small outage into a self-sustaining retry storm. Bronson et al.'s HotOS '21 study found retry-induced load amplification was the sustaining effect in more than half of the real-world metastable-failure incidents analysed.
Failure-class routing
Almost every real failure maps to one of three classes. Route each to its own handler; never use a single @retry over an undifferentiated exception stream.
| Class | Trigger | Response |
|---|---|---|
| Transient (your quota) | 429 ratelimiterror |
Honor retry-after and *-reset headers. Don't guess. |
| Systemic (provider down) | 529 overloaded_error, 500/503 |
Full-jitter backoff + per-provider circuit breaker + model fallback |
| Terminal (deterministic) | 400/401/403/413, contextlengthexceeded, content filters |
Never retry. Fix, fall back, or degrade. |
| Sunk-token (orthogonal flag) | Partial generation timed out/aborted mid-stream | Reconcile already-received output before deciding to replay. Re-billing from scratch is not "one more attempt". |
The routing rule most systems get wrong: only systemic failures may trip the provider circuit breaker. A breaker that opens because of your 400 (malformed request) or 429 (your quota) has taken itself offline for reasons that have nothing to do with provider health - while quietly disabling your fallback at the same time.
Conflating 429 and 529 is a specific bug
A 429 is a token bucket for your account - you exceeded RPM/ITPM/OTPM. Anthropic literally returns retry-after. Retryable, and the correct wait is exactly T seconds.
A 529 is overloaded_error - the provider shedding load across all customers. No retry-after you invent will fix capacity you don't own. Correct response: broad jittered backoff and a fallback to another model, gated by the circuit breaker. Treating "I'm over quota" and "the provider is down" as the same retryable-with-backoff event is a common mistake; that is precisely why the classifier separates them.
Circuit breaker - adapted for agents, not copied from microservices
The classic three-state breaker (Closed passes calls; Open blocks returning fallback; Half-Open probes once, resetting on success) applies, with agent-specific adaptations:
- Per-provider granularity. Each provider (and tool endpoint) gets its own breaker. A 529 in one provider must not open the breaker protecting your fallback provider.
- Systemic-only counting, session-scoped state - a rule against opening on your own quota or bugs; state persists across calls within a session.
- Fallback routing wired into the decision - open state must be surfaced to the routing/prompt layer so the agent can switch approaches, not just emit a generic exception.
Threshold tuning is empirical and the evidence grade is "medium" (no published token-savings measurements found), but the mechanics inherit from Hystrix/Resilience4j and Polly.
Containing faults in the DAG: the partial-failure contract
A microservice circuit breaker fails fast by throwing. An agent that throws into a fan-out orchestrator just relocates the cascade - an enrichment step failing should not kill synthesis. Make degradation a typed result, e.g. {enrichment: null, degraded: True}, that downstream steps are contractually required to handle (on the same level as normal outputs). Synthesis that assumes enrichment is always present produces confident garbage under load, or dies.
Isolation primitives that already exist
- Bulkhead - per-agent concurrency and per-provider token budget, so one thrashing agent cannot monopolise a shared pool and starve calls that would have succeeded.
- LangGraph
RetryPolicyis a useful floor, not the policy: its defaultretry-onalready refusesValueError/TypeError/SyntaxError(a primitive terminal/transient split), and under a checkpointer an errored node does not re-run siblings that already succeeded in that superstep (genuine graph-level fault isolation, checkpoint preserved on failure). But it will not honourretry-after, open a circuit, or fall back. Build those at the agent boundary; treatRetryPolicyas the transport-level safety net.
Practical checklist for the pipelines that matter here
Brian's trend-scout / content-agent / email-archive / Drive-sync jobs run on cron. Apply these before they meet a bad provider minute:
- Disable the SDK's auto-retry (
max_retries=0) once you own the policy. Stacked retry layers are the cause of most "it hung for ten minutes" reports. One policy, one place. - Classify before reacting. Three classes + sunk-token flag. Unrecognisable failure -> terminal -> fail fast; a wrong retry costs money.
- Never retry terminal errors.
contextlengthexceeded, content filters, 400/401/403. Route to fix-or-degrade, never a loop. - Honor
retry-after/reset headers for 429s. The provider literally told you when capacity returns. - Full jitter for systemic backoff (AWS full jitter:
random(0, min(cap, base × 2^attempt))). No jitter = synchronised fleet = metastable trap. - Bound by wall-clock deadline, not attempt count. 6 × 15s can blow a 30s budget. Pass the deadline down.
- Trip the breaker only on systemic failures, keyed per provider.
- Degradation as an explicit (typed) contract returned into the DAG - with a bulkhead budget per agent.
- Budget money, not just time - track sunk-token cost of a replay. Time and money run out at different rates ("two-budget rule").
- Lean on a gateway (litellm, Portkey) for out-of-process handling - centralised cooldowns, context-window fallbacks, multi-provider breakers. Verify defaults (litellm cooldown is 1 second - tune it).
The honest framing
Exponential backoff is not wrong. It is a precise instrument for transient, independent, cheap, idempotent failures, at which it is excellent. LLM calls are simply none of those things. Stop treating "an LLM call failed" as one event; treat it as four different events with four different costs, and your pipelines stop amplifying outages and start containing them. Classify first. Retry last.
Sources
- https://ranjankumar.in/fault-isolation-circuit-breaking-llm-agent-pipelines
- https://agentic-patterns.com/patterns/agent-circuit-breaker/
- https://platform.claude.com/docs/en/api/rate-limits
- https://martinfowler.com/bliki/CircuitBreaker.html
- https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
- https://tianpan.co/blog/2026-04-16-retry-budget-llm-agent-cost-amplification