Class RetryPolicy
Retry configuration. Partial overrides inherit unset fields from the client or SDK defaults. Defaults match the JavaScript SDK.
public sealed class RetryPolicy
- Inheritance
-
RetryPolicy
- Inherited Members
Properties
ApiConnectionError
Retry connection failures, including interrupted response bodies. Default: true.
public bool ApiConnectionError { get; set; }
Property Value
ApiTimeoutError
Whether to retry ApiTimeoutException. Default: true.
public bool ApiTimeoutError { get; set; }
Property Value
BackoffInitialMs
First backoff delay in milliseconds, doubled up to BackoffMaxMs. Default: 500.
public int BackoffInitialMs { get; set; }
Property Value
BackoffJitter
Fraction of each backoff delay randomly subtracted, from 0 to 1. Default: 0.25.
public double BackoffJitter { get; set; }
Property Value
BackoffMaxMs
Maximum backoff delay in milliseconds. Default: 5000.
public int BackoffMaxMs { get; set; }
Property Value
Default
SDK default retry policy (a new isolated copy).
public static RetryPolicy Default { get; }
Property Value
HttpStatuses
HTTP status codes to retry. Default: 408, 429, and 500–599.
public ISet<int> HttpStatuses { get; set; }
Property Value
MaxRetries
Maximum retries after the initial attempt; 0 disables retries. Default: 2.
public int MaxRetries { get; set; }
Property Value
MaxRetryAfterMs
Maximum server retry delay in milliseconds; longer delays use backoff. Default: 60000.
public int MaxRetryAfterMs { get; set; }
Property Value
RespectRetryAfter
Honor Retry-After and retry-after-ms up to MaxRetryAfterMs. Default: true.
public bool RespectRetryAfter { get; set; }
Property Value
Methods
Clone()
Copy this policy so later mutations cannot affect in-flight requests.
public RetryPolicy Clone()
Returns
Resolve(RetryPolicy, RetryPolicy?)
Merge overrides onto a base policy and validate every numeric field.
public static RetryPolicy Resolve(RetryPolicy baseline, RetryPolicy? overrides)
Parameters
baselineRetryPolicyoverridesRetryPolicy
Returns
Validate()
Validate a fully-specified constructor policy.
public RetryPolicy Validate()