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

Allow jitter for all backoff types #1445

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Allow jitter for all backoff types #1445

merged 2 commits into from
Jul 28, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Jul 28, 2023

Details on the issue fix or feature implementation

For context:
https://github.com/App-vNext/Polly/pull/1233/files#r1251595389

If jitter is used, then the final delay is randomized between the factor of 1 ... 1.5.

This applies for constant and linear delay, for exponential delay the formula is more complicated. (no changes)

Contributes to #1301

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 Jul 28, 2023
@martintmk martintmk added this to the v8.0.0 milestone Jul 28, 2023
@@ -34,6 +34,18 @@ public class RetryStrategyOptions<TResult> : ResilienceStrategyOptions
/// </value>
public RetryBackoffType BackoffType { get; set; } = RetryConstants.DefaultBackoffType;

/// <summary>
/// Gets or sets a value indicating whether the jitter should be used when calculating the backoff delay between retries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Gets or sets a value indicating whether the jitter should be used when calculating the backoff delay between retries.
/// Gets or sets a value indicating whether jitter should be used when calculating the backoff delay between retries.

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #1445 (044d6a5) into main (9a63e4e) will increase coverage by 0.13%.
Report is 29 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1445      +/-   ##
==========================================
+ Coverage   83.83%   83.97%   +0.13%     
==========================================
  Files         274      276       +2     
  Lines        6491     6544      +53     
  Branches     1008     1015       +7     
==========================================
+ Hits         5442     5495      +53     
  Misses        840      840              
  Partials      209      209              
Flag Coverage Δ
linux 83.97% <100.00%> (?)
macos 83.97% <100.00%> (+0.13%) ⬆️
windows 83.97% <100.00%> (+0.13%) ⬆️

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

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

... and 54 files with indirect coverage changes

@martintmk martintmk enabled auto-merge (squash) July 28, 2023 06:10
@martintmk martintmk merged commit 2f10d19 into main Jul 28, 2023
16 checks passed
@martintmk martintmk deleted the mtomka/retries branch July 28, 2023 07:05
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