Skip to article
TOOLS. SYSTEMS. BETTER DECISIONS.
Stack & Method

The journal

When a 429 or 503 Says Retry-After: Turn the Header Into a Wait Window

Read both allowed forms and decide whether a request can wait, be deferred or should stop.

A simple timer and dark notebook rest on a light work surface.
Write down the earliest eligible time before starting another attempt.
Stack & MethodStack & Method

At a glance

A 429 or 503 can be temporary. Read Retry-After first, then retry only if the operation is safe to repeat and the schedule can honor the requested wait.

Diagnose a recurring 429

A 429 or 503 may be eligible for a later attempt. Check whether the operation is safe to repeat, read any Retry-After header and compare the resulting wait with the time this job can spend. A response status alone does not answer all three questions.

Decide whether the operation may be repeated

Check the operation and the provider’s policy. A read request and a request that creates a record can have different consequences. When a prior attempt could already have caused an effect, use the platform’s documented duplicate protection or verify the prior result. Avoid sending a new attempt just because a worker did not get a useful response.

A 429 indicates rate limiting. A 503 can indicate temporary unavailability. Both can be accompanied by guidance about waiting. Keep the provider’s wider limits and your own attempt cap in view while handling the response.

For the status and optional header, see RFC 6585: 429 Too Many Requests.

Sources: RFC 6585: 429 Too Many Requests · RFC 9110: Retry-After · RFC 9110: Idempotent Methods

Read delay-seconds and HTTP-date

The numeric form is seconds. If a response received at 12:00:00 UTC says 15, the earliest time in this simplified example is 12:00:15 UTC. Keep the units explicit if your waiting function expects milliseconds.

The date form is an absolute time. For a valid HTTP date of 12:01:30 UTC, measured from receipt at 12:00:00 UTC, the wait is 90 seconds in the fixture. Use an HTTP date parser and keep clock error in mind. An invalid or missing value needs a separate branch for your configured fallback policy.

Delay seconds produce 15 seconds, and an HTTP date ninety seconds later produces a 90-second wait.
Use appropriate units and the clock at receipt to calculate timing.

For the field grammar, see RFC 9110: Retry-After.

Sources: IETF

Compare the wait with the job budget

Suppose the job can wait 30 more seconds. The first value fits, if the other checks pass. The second does not. Do not cap the server’s 90-second timing at the worker’s 30-second deadline and then send the request. If deferred work is supported, preserve the eligible time and the original operation reference. Otherwise stop with a reason that distinguishes a deadline from an invalid response.

Keep a separate attempt limit. The timing field says when a repeat could be considered; it does not override the operation’s policy or make an indefinite chain acceptable.

Assume the response arrives at 12:00:00 UTC and the worker has 30 seconds.
Header fieldWaitExample disposition
1515 sWithin the job budget
HTTP date 12:01:30 UTC90 sDefer or stop
Invalid or absentUse endpoint policyBounded fallback only if eligible
Timeline marks a 15-second delay, a 30-second job deadline, and a 90-second requested wait.
Durable deferral can preserve the timing when the current job cannot.

What if the worker has 30 seconds left?

Numeric delay of 15

Fifteen seconds fits the example budget. Check operation safety and the attempt limit before scheduling.

A date 90 seconds away

The current job cannot honor that wait. Defer with the timestamp or stop according to your policy.

Sources: RFC 9110: Retry-After · RFC 6585: 429 Too Many Requests

Record the decision and keep retries bounded

Record the status, normalized timing, current attempt and decision. Use names such as scheduled after delay, deferred at deadline or skipped for unsafe repeat. Avoid copying authorization headers or payloads into operator logs. Where several jobs share a provider quota, keep pacing coordinated so a fleet of retries does not hit the service as one burst.

The handoff preserves status, computed earliest time and decision.
Check the attempt limit and operation safety separately.
Two blue-gray paper trays hold a few plain slips.
Use a separate deferred queue when an eligible job cannot wait inline.

Check before repeating a request

  • Identify the status and operation.
  • Read the two allowed header forms.
  • Compare the wait with the deadline.
  • Keep the original operation reference.

For retry safety by method, see RFC 9110: Idempotent Methods.

For the related task, see Check whether the provider protects repeats.

Sources: RFC 9110: Idempotent Methods · RFC 6585: 429 Too Many Requests

Frequently asked questions

Can I reinterpret a Retry-After delay as milliseconds?

No. The numeric form is seconds. Convert it explicitly to the units used by your timer.

What if a date is already in the past?

The date no longer asks for a future wait. Apply your minimum pacing, attempt limit and operation rules.

Is a 429 or 503 always safe to retry?

Check the operation’s contract and whether the previous attempt could have taken effect. Status alone does not prove that a repeat is safe.

What if the header is missing?

Use the provider’s documentation and your bounded backoff policy for requests that are eligible. Avoid an immediate burst.

Stack & MethodStack & Method

Diagnose why the rate limit is recurring

Use pacing and a shared limit if several workers share a quota.

Diagnose a recurring 429

Continue with a related guide

References

Your privacy choices

Optional analytics helps us improve these guides. It stays off until you allow it. Privacy details