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.
Constructor
ExponentialRetry(initial_backoff: int = 15, increment_base: int = 3, retry_total: int = 3, retry_to_secondary: bool = False, random_jitter_range: int = 3, **kwargs)Parameters
| Name | Description | 
|---|---|
| initial_backoff | The initial backoff interval, in seconds, for the first retry. Default value: 15 | 
| increment_base | The base, in seconds, to increment the initial_backoff by after the first retry. Default value: 3 | 
| max_attempts 
				Required
			 | The maximum number of retry attempts. | 
| 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 | 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 | 
| retry_total | Default value: 3 | 
Methods
| configure_retries | Configure the retry settings for the request. | 
| get_backoff_time | Calculates how long to sleep before retrying. | 
| increment | Increment the retry counters. | 
| send | |
| sleep | 
configure_retries
Configure the retry settings for the request.
configure_retries(request: PipelineRequest) -> Dict[str, Any]Parameters
| Name | Description | 
|---|---|
| request 
				Required
			 | A pipeline request object. | 
Returns
| Type | Description | 
|---|---|
| A dictionary containing the retry settings. | 
get_backoff_time
Calculates how long to sleep before retrying.
get_backoff_time(settings: Dict[str, Any]) -> floatParameters
| Name | Description | 
|---|---|
| settings 
				Required
			 | The configurable values pertaining to the backoff time. | 
Returns
| Type | Description | 
|---|---|
| 
							int, 
						 | An integer indicating how long to wait before retrying the request, or None to indicate no retry should be performed. | 
increment
Increment the retry counters.
increment(settings: Dict[str, Any], request: PipelineRequest, response: PipelineResponse | None = None, error: AzureError | None = None) -> boolParameters
| Name | Description | 
|---|---|
| settings 
				Required
			 | The configurable values pertaining to the increment operation. | 
| request 
				Required
			 | A pipeline request object. | 
| response | A pipeline response object. Default value: None | 
| error | 
				AzureError or 
				None
		 An error encountered during the request, or None if the response was received successfully. Default value: None | 
Returns
| Type | Description | 
|---|---|
| Whether the retry attempts are exhausted. | 
send
async send(request)Parameters
| Name | Description | 
|---|---|
| request 
				Required
			 |  | 
sleep
async sleep(settings, transport)Parameters
| Name | Description | 
|---|---|
| settings 
				Required
			 |  | 
| transport 
				Required
			 |  | 
Attributes
connect_retries
The max number of connect retries.
connect_retries: intincrement_base
The base, in seconds, to increment the initial_backoff by after the first retry.
increment_base: intinitial_backoff
The initial backoff interval, in seconds, for the first retry.
initial_backoff: intnext
Pointer to the next policy or a transport (wrapped as a policy). Will be set at pipeline creation.
next: HTTPPolicy[HTTPRequestType, HTTPResponseType]random_jitter_range
A number in seconds which indicates a range to jitter/randomize for the back-off interval.
random_jitter_range: intretry_read
The max number of read retries.
retry_read: intretry_status
The max number of status retries.
retry_status: intretry_to_secondary
Whether the secondary endpoint should be retried.
retry_to_secondary: booltotal_retries
The max number of retries.
total_retries: int