[FEATURE REQ] RetryPolicy / RetryOptions - configurable exponent & random boundaries and/or custom retry mode (user provided CalculateExponentialDelay) #34611
Closed
Description
Library name
Azure.Core
Please describe the feature.
Consider the existing method for calculating exponential backoff delay:
As you can see, the following are hard-coded:
- Exponent
1 <<
basically meansMath.Pow(2, attempt - 1)
(so it's set to2
) - Lower random boundary (
0.8
) - Upper random boundary (
1.2
)
The exponent especially can be critical to the resulting delay time series, but since exposing all the above seems very simple (basically add 3 properties to RetryOptions
), might as well add them too.
In addition, a RetryMode.Custom
could be added which allows setting a custom-provided CalculateExponentialDelay
. I suppose if we have this kind of extensibility then parametrizing the above properties won't be strictly needed, but IMHO it would be nice to have all the same (e.g. the Azure.Core team might improve the method yet retain the constants used, for example guard better against overflow).
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that