Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ halfopen
hangfire
httpclient
httpclientfactory
idempotent
ietf
interop
jetbrains
Expand Down
5 changes: 5 additions & 0 deletions docs/strategies/retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ new ResiliencePipelineBuilder<HttpResponseMessage>().AddRetry(optionsExtractDela
| `DelayGenerator` | `null` | This optional delegate allows you to **dynamically** calculate the retry delay by utilizing information that is only available at runtime (like the attempt number). |
| `OnRetry` | `null` | If provided then it will be invoked before the strategy delays the next attempt. |

> [!IMPORTANT]
> The retry strategy re-executes the callback, so the work it performs can be applied more than once. With the defaults, any exception other than `OperationCanceledException` is retried, including failures that happen after the work has already taken effect. For example, if the connection is lost after a database transaction has been committed but before the reply reaches the client, the retry runs the transaction again, its changes are applied twice and the call returns normally.
>
> Only retry operations that are idempotent, or make them safe to retry, for example by sending a unique key that lets the receiver detect duplicates or by checking the outcome of the previous attempt before trying again. You can also use `ShouldHandle` to limit retries to failures where the operation is known not to have taken effect.

## Telemetry

The retry strategy reports the following telemetry events:
Expand Down