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

feat: add exponential backoff retry strategy #428

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

nand4011
Copy link
Contributor

Add a new retry strategy that waits for a jittered, exponentially increasing time between attempts until the deadline passes.

@nand4011 nand4011 requested review from rishtigupta and a team February 12, 2025 17:36
Add a new retry strategy that waits for a jittered, exponentially
increasing time between attempts until the deadline passes.
@nand4011 nand4011 force-pushed the exponential-backoff-retry branch from 8c5f793 to da5c62f Compare February 12, 2025 17:38
Add a deadline check to the RetryClientInterceptor so that it won't
retry after the deadline has passed. If this isn't present, retries will
still happen, but will immediately fail.
@nand4011 nand4011 marked this pull request as ready for review February 13, 2025 00:31
Add docs to ExponentialBackoffRetryStrategy.

Add new constructors to ExponentialBackoffRetryStrategy: one that uses
defaults for initial delay and max backoff, and one that uses the
default eligibility strategy.

Make computePreviousBaseDelay return initial delay if currentBaseDelay
is equal to the initial delay to prevent it from returning 0.

Use the default eligibility strategy in the exponential backoff
integration tests.

Add a new integration test to show that ExponentialBackoffRetryStrategy
will work if there is a temporary network outage.

Rename the testNonRetryEligible temporary outage fixed delay test to
testRetryEligible, because it is testing an eligible method.
@nand4011 nand4011 force-pushed the exponential-backoff-retry branch from e9b98f6 to 2614086 Compare February 19, 2025 00:13
@nand4011 nand4011 requested a review from rishtigupta February 19, 2025 00:18
Copy link
Contributor

@rishtigupta rishtigupta left a comment

Choose a reason for hiding this comment

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

:shipit:

@nand4011 nand4011 merged commit 0d88fd9 into main Feb 19, 2025
6 checks passed
@nand4011 nand4011 deleted the exponential-backoff-retry branch February 19, 2025 00:26
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