-
Notifications
You must be signed in to change notification settings - Fork 8
fix: fixed timeout retry strategy was stopping retries too early when retry deadline passed #606
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tests/Integration/Momento.Sdk.Tests/Retry/FixedTimeoutRetryStrategyTest.cs:176
- [nitpick] The jitter bounds in this test (0.85 - 1.15 multiplier) differ from those in other tests (0.9 - 1.1). Please confirm this discrepancy is intentional.
var minDelay = RETRY_DELAY.TotalMilliseconds * 0.85;
… retry deadline passed
…line on FixedTimeoutRetryStrategy
dd0d131 to
1a9f550
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great last change. I just recommend commenting on the fixed timeout retyr strategy to indicate the version of determine when to retry without the overall deadline won't be invoked/is a trivial implementation.
src/Momento.Sdk/Config/Retry/ExponentialBackoffRetryStrategy.cs
Outdated
Show resolved
Hide resolved
src/Momento.Sdk/Config/Retry/ExponentialBackoffRetryStrategy.cs
Outdated
Show resolved
Hide resolved
|
To recap the state of this PR:
End result should be cleaner implementation of |
Work towards https://github.com/momentohq/dev-eco-issue-tracker/issues/1214
The fixed timeout retry strategy was not properly handling the case when a retry deadline was exceeded--instead of resetting the deadline and trying again, it was returning after only one retry attempt with a Cancelled error.
This PR makes sure that there are retries until the overall client timeout has passed.
Updated the "long delays" test to ensure that it retries at least twice and that the average time between retries is approximately equal to the retry timeout. This is because the first request should experience the long delay, attempt a retry, then hit the retry deadline and cancel that retry attempt rather than wait the entire
longDelayperiod.Also refactored so that
CalculateRetryDeadlineexists only on FixedTimeoutRetryStrategy (the only strategy where it's relevant) and removed theGetResponseDataReceivedTimeoutMillisgetter. There have been no recent dotnet sdk releases so this shouldn't be a breaking change and is a cleaner implementation.Renamed
ResponseDataReceivedTimeoutMillistoRetryTimeoutMillisfor clarity