Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the retry backoff type default to constant #1260

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Jun 7, 2023

Details on the issue fix or feature implementation

Based on the API review:
image

The default in RetryStrategyOptions.BackoffType is now Constant.

Type-speciifc options can use different default. For example here:
https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.Http.Resilience/Polly/HttpRetryPolicyOptions.cs

We can just do:

public class HttpRetryStrategyOptions : RetryStrategyOptions<HttpResponseMessage>
{
   publc HttpRetryStrategyOptions() => BackoffType = RetryBackoffType.ExponentialWithJitter;
}

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Jun 7, 2023
@martintmk martintmk added this to the v8.0.0 milestone Jun 7, 2023
@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #1260 (d1be3fc) into main (dcbd172) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1260   +/-   ##
=======================================
  Coverage   83.12%   83.12%           
=======================================
  Files         269      269           
  Lines        6239     6239           
  Branches      976      976           
=======================================
  Hits         5186     5186           
  Misses        844      844           
  Partials      209      209           
Flag Coverage Δ
linux 83.12% <ø> (ø)
macos 83.12% <ø> (ø)
windows 83.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Polly.Core/Retry/RetryConstants.cs 100.00% <ø> (ø)
...c/Polly.Core/Retry/RetryStrategyOptions.TResult.cs 100.00% <ø> (ø)

... and 88 files with indirect coverage changes

@martintmk martintmk merged commit 70d1bd9 into main Jun 7, 2023
@martintmk martintmk deleted the mtomka/retry-default branch June 7, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants