Language

HttpRetryBudgetOptions Class

Definition

Options for the retry budget that limits the number of retries relative to the number of requests.

public ref class HttpRetryBudgetOptions
[System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public class HttpRetryBudgetOptions
public class HttpRetryBudgetOptions
[<System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type HttpRetryBudgetOptions = class
type HttpRetryBudgetOptions = class
Public Class HttpRetryBudgetOptions
Inheritance
HttpRetryBudgetOptions
Attributes

Remarks

The retry budget tracks the number of requests and retries over a sliding window of SamplingDuration. Once the window contains at least MinimumThroughput requests, a retry is only allowed while the number of retries in the window is below RetryRatio multiplied by the number of requests, rounded down. At least one retry per window is always allowed, unless RetryRatio is 0, which suppresses every retry. When the budget is exhausted, the outcome that would have been retried is returned to the caller instead and the OnRetryBudgetExhausted resilience event is reported with OnRetryBudgetExhaustedArguments.

The budget prevents retry storms: when a dependency is degraded, retries can multiply the load on it by up to MaxRetryAttempts + 1. A budget caps that amplification to roughly 1 + RetryRatio.

A budget instance is shared by all requests that use the same resilience pipeline instance. Each named client (and each authority when SelectPipelineByAuthority is used) has its own budget. The budget is reset when the pipeline is reloaded due to options changes.

Constructors

Name Description
HttpRetryBudgetOptions()

Properties

Name Description
MinimumThroughput

Gets or sets the minimum number of requests within the sampling window before the budget is enforced.

RetryRatio

Gets or sets the maximum ratio of retries to requests within the sampling window.

SamplingDuration

Gets or sets the duration of the sliding window used to track requests and retries.

Applies to