Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Retry · Error Handling

Direct answer

Retry in error handling repeats a failed operation for transient problems like timeouts or HTTP 503, with a maximum count and backoff, such as until/retries in Ansible.

When to use this

Use this when transient errors should be retried.

First 30 seconds

1. Retry transient errors (timeouts, 429, 503, connection resets).

2. Limit attempts.

3. Idempotent operations only.

4. Log attempts.

5. Escalate after final failure.

Operational verification

transient error → retry → success/give up

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
automation retry/timeout/failure control
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformautomation retry/timeout/failure control · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when transient errors should be retried.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as ambiguous target identity, stale inputs, partial success, unsafe retry, permission drift and confusing tool completion with target-evidence of the actual state, choosing the cases most relevant to failure classification, maximum attempts, backoff/jitter, idempotency/deduplication and stopping retries for permanent or ambiguous failures.

Step 2 Common mistakes Narrow the fault
  • Unlimited retries.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Retry transient errors like timeouts and HTTP 503.
  • Limit retries and back off.
  • Only retry safe operations.
Key checks
  • Retry wrapper with attempts — policy
  • Only idempotent operations retried — safety
  • Retry logging — visibility
ReferenceWhy it matters1 section · depth on demand

In depth

Retry repeats a failed operation in the hope that the cause was temporary — a network blip, a busy API, a lock held by another process. It turns many transient failures into successes without human involvement, but only if applied to the right errors and with limits.

Rules:

  • Retry only transient errors (timeouts, HTTP 429/503, connection reset); never retry validation or permission errors.
  • Limit attempts and total time.
  • Wait between attempts, increasing the delay (exponential backoff with jitter).
  • Make the retried operation idempotent, or a retry can duplicate work.
for attempt in range(5):
    try:
        return call_api()
    except (TimeoutError, RateLimited):
        time.sleep(min(60, 2 ** attempt) + random.random())
raise RuntimeError("gave up after 5 attempts")
- uri: { url: "{{ api }}/status" }
  register: r
  until: r.status == 200
  retries: 5
  delay: 10
ReferenceImportant terms & boundaries1 section · depth on demand
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docautomation retry/timeout/failure control current

Authoritative/upstream documentation reviewed for bounded claims in Error Handling > Retry. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/azure/architecture/patterns/retry · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For failure classification, maximum attempts, backoff/jitter, idempotency/deduplication and stopping retries for permanent or ambiguous failures, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?