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

Fix retry overflow with max delay #1868

Merged

Conversation

Chr15P13t
Copy link
Contributor

Pull Request

The issue or feature being addressed

Fix issue #1866 Retry Startegy stops retrying unexpectedly

Details on the issue fix or feature implementation

In case computing retry delay throws OverflowException, RetryHelper.GetRetryDelay(...) returns maxDelay.value if not null, TimeSpan.MaxValue otherwise.

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

@Chr15P13t
Copy link
Contributor Author

@dotnet-policy-service agree

Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

Just one minor suggestion.

src/Polly.Core/Retry/RetryHelper.cs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ec47cfd) 84.58% compared to head (8aeba3f) 84.59%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1868   +/-   ##
=======================================
  Coverage   84.58%   84.59%           
=======================================
  Files         308      308           
  Lines        6799     6801    +2     
  Branches     1049     1050    +1     
=======================================
+ Hits         5751     5753    +2     
  Misses        839      839           
  Partials      209      209           
Flag Coverage Δ
linux 84.59% <100.00%> (+<0.01%) ⬆️
macos 84.59% <100.00%> (+<0.01%) ⬆️
windows ?

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martincostello martincostello enabled auto-merge (squash) December 26, 2023 18:39
@martincostello martincostello merged commit e18818a into App-vNext:main Dec 26, 2023
14 checks passed
@martincostello martincostello added this to the v8.3.0 milestone Dec 26, 2023
@Chr15P13t Chr15P13t deleted the fix-retry-overflow-with-max-delay branch December 27, 2023 08:25
@martincostello martincostello modified the milestones: v8.3.0, v8.2.1 Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants