pub struct RetryConfig {
pub backoff: BackoffConfig,
pub max_retries: usize,
pub retry_timeout: Duration,
}Expand description
The configuration for how to respond to request errors.
The following categories of error will be retried:
- 5xx server errors
- Connection errors
- Dropped connections
- Timeouts for safe / read-only requests
Requests will be retried up to some limit, using exponential
backoff with jitter. See BackoffConfig for more information.
§Default values
| Field | Default | Guidance |
|---|---|---|
max_retries | 10 | Reduce to 3–5 for latency-sensitive interactive paths |
retry_timeout | 180 s | Keep below 5 minutes so credentials stay valid across all retry attempts |
backoff | see BackoffConfig | Exponential with jitter; tune base / deadline for your SLA |
Fields§
§backoff: BackoffConfigThe backoff configuration
max_retries: usizeThe maximum number of times to retry a request
Set to 0 to disable retries
retry_timeout: DurationThe maximum length of time from the initial request after which no further retries will be attempted
This not only bounds the length of time before a server error will be surfaced to the application, but also bounds the length of time a request’s credentials must remain valid.
As requests are retried without renewing credentials or regenerating request payloads, this number should be kept below 5 minutes to avoid errors due to expired credentials and/or request payloads
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more