question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQ] RetryPolicy / RetryOptions - configurable exponent & random boundaries and/or custom retry mode (user provided CalculateExponentialDelay)

See original GitHub issue

Library name

Azure.Core

Please describe the feature.

Consider the existing method for calculating exponential backoff delay: https://github.com/Azure/azure-sdk-for-net/blob/4d8a0979d83ffd6f52e97b3eeeab28858f50ccba/sdk/core/Azure.Core/src/Pipeline/RetryPolicy.cs#L331

As you can see, the following are hard-coded:

  1. Exponent 1 << basically means Math.Pow(2, attempt - 1) (so it’s set to 2)
  2. Lower random boundary (0.8)
  3. 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).

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshLove-msftcommented, Apr 19, 2023
1reaction
JoshLove-msftcommented, Apr 17, 2023

Ah my bad - you were referring to the exponent factor not the jitter factor. For that, you would need to define your own custom strategy as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retry behavior - AWS SDKs and Tools
Retry behavior includes settings regarding how the SDKs attempt to recover from failures resulting from requests made to AWS services. Configure this ...
Read more >
RetryPolicy (AWS SDK for Java - 1.12.533)
Retry policy that can be configured on a specific service client using ClientConfiguration . This class is immutable, therefore safe to be shared...
Read more >
Implement HTTP call retries with exponential backoff ...
The following steps show how you can use Http retries with Polly integrated into IHttpClientFactory , which is explained in the previous ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found