# Retry Policies

Retry policies define when a failed operation is attempted again, how long to wait between attempts, and when to stop.

Cloud concept. Updated 2026-11-26. Page: https://blowstack.com/tools/cloud-concepts-hub/retry-policies

> A retry policy lets a client, worker, or orchestrator recover automatically from temporary failures such as throttling, network interruptions, or lost compute. It improves reliability when the operation is safe to repeat, but poorly bounded retries can duplicate side effects, increase latency, and worsen an outage.

Practice exams covering Retry Policies: [DVA-C03 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate).

## 5 key aspects of Retry Policies

An effective retry policy selects recoverable failures, spaces and bounds attempts, repeats work safely, and makes exhausted retries visible.

1. **Failure classification**: Retry failures that are likely to clear, such as temporary throttling or worker loss. Keep permanent errors out of the retry path and treat timeouts as unknown outcomes rather than proof that nothing happened.
2. **Backoff and jitter**: Increase delays between attempts when a dependency needs time to recover, and add randomness to avoid synchronized retry bursts. Use a service-provided retry delay when applicable and when it fits the overall deadline.
3. **Attempt and time budgets**: Bound retries with an attempt limit, per-attempt timeouts, and an overall deadline. Coordinate budgets across clients and orchestrators so nested retries do not multiply load beyond what the dependency can handle.
4. **Safe repetition and restart scope**: Retry the smallest unit that can recover safely, whether that is a request, task, or entire run. Use idempotency keys, durable checkpoints, or deduplicated writes where appropriate, and verify that replay cannot create conflicting work.
5. **Visibility and terminal handling**: Track attempts and distinguish recovered failures from exhausted retries. Define what happens when retrying stops, such as failing the run, alerting an owner, or routing a message to a dead-letter queue.

## Cloud services for Retry Policies

These services implement retries at different boundaries. Azure Databricks and Azure Data Factory can retry failed units of data processing, while AWS Step Functions applies error-specific policies to workflow states. Google Cloud Tasks retries delivery to a handler independently of the workflow that submitted the task. When an orchestrator, queue, and client are used together, assign each layer a distinct responsibility: let the client handle brief request failures, let the orchestrator handle recoverable task failures, and make the handler safe to invoke again after an ambiguous delivery. Share an end-to-end budget so one layer does not keep retrying after another has already given up.

- **[Azure Databricks](https://blowstack.com/tools/cloud-services-hub/azure-databricks)**: Lakeflow Jobs lets engineers configure task retries, including the retry limit, the minimum interval between attempts, and whether a timed-out task is eligible for retry. A retry on a pipeline task reruns that task rather than rerunning every task in the job.
- **[AWS Step Functions](https://blowstack.com/tools/cloud-services-hub/aws-step-functions)**: Step Functions retriers match state errors and control the retry interval, attempt limit, backoff rate, and optional jitter. A Catch handler can route failures that remain after matching retries are exhausted.
- **[Azure Data Factory](https://blowstack.com/tools/cloud-services-hub/azure-data-factory)**: Supported pipeline activities expose a retry count, retry interval, and activity timeout through their activity policy. This lets a pipeline rerun a failed activity without repeating earlier activities that already succeeded.

## What is Retry Policies

A retry policy turns a failure into a decision: try again, stop, or hand off to another recovery path. It defines which failures qualify, how many retries are allowed, how attempts are spaced, and how much total time the operation can consume. Retry a condition likely to clear, such as temporary throttling or an interrupted connection. Fail promptly on an invalid request or missing permission unless the workflow has an explicit way to correct it. Treat a timeout as ambiguous: the caller stopped waiting, but the remote operation may still be running or may already have succeeded.

Set both a per-attempt timeout and an overall deadline. For example, a client issuing a read might allow two retries after the initial attempt, wait longer after each failure, and stop if the next attempt cannot fit within the caller's deadline. Exponential backoff gives an overloaded dependency time to recover, and jitter spreads retries from clients that failed at the same time. When a service supplies a retry delay, honor it on retryable responses if the remaining deadline permits. Check whether a configuration field counts retries or total attempts: two retries usually means up to three attempts.

For a job or data pipeline, choose the smallest restart scope that can recover safely. Configure automatic retries on a failed task when completed upstream work can be reused. Restart an entire run only when its stages need to be rebuilt together or the orchestrator cannot safely resume at a narrower boundary. For example, after a worker is lost, an ingestion task can resume from a durable checkpoint if the source and sink support that recovery model. A checkpoint alone does not prevent duplicate writes: if output was committed before progress was recorded, the restarted task may replay the same records. Use transactional commits, stable record keys with upserts, or another deduplication mechanism appropriate to the sink.

Repeating a non-idempotent write is not safe just because the first attempt returned an error. If a request to create a resource times out, reuse the same idempotency key where the service supports it, or reconcile the original outcome before sending another create request. For jobs that time out, verify whether the original execution is actually canceled before starting a replacement that could write to the same destination.

Coordinate retries across layers. If a client library makes three attempts and an orchestrator reruns its task three times in total, one logical operation can produce nine downstream calls. Give short-lived request failures and longer-lived task failures distinct retry budgets, and account for overlapping schedules and concurrency limits. Record attempt counts, failure categories, delays, and final outcomes so operators can distinguish recovery from persistent degradation. When a budget is exhausted, surface the failure, alert the owner, or route an eligible message to a dead-letter queue rather than retrying indefinitely.

## Retry Policies exam questions

Real practice exam questions on Retry Policies, with the correct answer and its explanation.

### Question 1 (DVA-C03)

**Question:**

A fulfillment company uses an AWS Lambda function to apply shipment status updates from an Amazon SQS FIFO queue. All updates for a shipment share a message group ID. In one batch, Lambda applies the first two updates for a shipment, but the tracking database returns a temporary error on the third. The fourth update is for the same shipment. The company must keep batched delivery, avoid replaying the first two updates because of this failure, and ensure the fourth update is not applied before the third succeeds. Lambda must manage message deletion. Which change meets these requirements?

**Correct answer:** Enable `ReportBatchItemFailures` on the event source mapping. Catch the exception, stop processing the batch, and return the message IDs of the third and fourth updates as `itemIdentifier` values in `batchItemFailures`.

**Explanation:** Lambda deletes the two successful messages and leaves the failed third message and the unprocessed fourth message in the queue for redelivery. Stopping at the first failure prevents the fourth update from being applied out of order.

## Practice Retry Policies in a full exam

Questions on Retry Policies in each practice exam, with every answer option and an explanation for each:

- [DVA-C03](https://blowstack.com/practice-exams/aws-certified-developer-associate): 12 questions

## Learn Retry Policies in lessons

5 short lessons on Retry Policies in 1 certification course.

- DVA-C03: Exponential Backoff vs. Retry Policies (free), https://app.blowstack.com/lessons/exponential-backoff-vs-retry-policies-dva-c03
- DVA-C03: Idempotency vs. retry policies (free), https://app.blowstack.com/lessons/idempotency-vs-retry-policies-dva-c03
- DVA-C03: Dead-Letter Queues vs. Retry Policies (free), https://app.blowstack.com/lessons/dead-letter-queues-vs-retry-policies-dva-c03
- DVA-C03: Graceful Degradation vs. Retry Policies (free), https://app.blowstack.com/lessons/graceful-degradation-vs-retry-policies-dva-c03
- DVA-C03: Retry Policies: bounded retries (free), https://app.blowstack.com/lessons/retry-policies-bounded-retries-dva-c03
