ExponentialRetry Class

Exponential retry.

Constructs an Exponential retry object. The initial_backoff is used for the first retry. Subsequent retries are retried after initial_backoff + increment_power^retry_count seconds. For example, by default the first retry occurs after 15 seconds, the second after (15+3^1) = 18 seconds, and the third after (15+3^2) = 24 seconds.

Inheritance
azure.storage.common.retry._Retry
ExponentialRetry

Constructor

ExponentialRetry(initial_backoff=15, increment_base=3, max_attempts=3, retry_to_secondary=False, random_jitter_range=3)

Parameters

Name Description
initial_backoff
int

The initial backoff interval, in seconds, for the first retry.

default value: 15
increment_base
int

The base, in seconds, to increment the initial_backoff by after the first retry.

default value: 3
max_attempts
int

The maximum number of retry attempts.

default value: 3
retry_to_secondary

Whether the request should be retried to secondary, if able. This should only be enabled of RA-GRS accounts are used and potentially stale data can be handled.

default value: False
random_jitter_range
int

A number in seconds which indicates a range to jitter/randomize for the back-off interval. For example, a random_jitter_range of 3 results in the back-off interval x to vary between x+3 and x-3.

default value: 3

Methods

retry

retry

retry(context)

Parameters

Name Description
context
Required