Questions tagged [exponential-backoff]
76 questions
34
votes
3 answers
What is the benefit of using exponential backoff?
When the code is waiting for some condition in which delay time is not deterministic, it looks like many people choose to use exponential backoff, i.e. wait N seconds, check if the condition satisfies; if not, wait for 2N seconds, check the…

xis
- 24,330
- 9
- 43
- 59
23
votes
3 answers
Why is random jitter applied to back-off strategies?
Here is some sample code I've seen.
int expBackoff = (int) Math.pow(2, retryCount);
int maxJitter = (int) Math.ceil(expBackoff*0.2);
int finalBackoff = expBackoff + random.nextInt(maxJitter);
I was wondering what's the advantage of using a random…

Will_of_fire
- 1,089
- 4
- 12
- 24
13
votes
1 answer
Exponential backoff with message order guarantee using spring-kafka
I'm trying to implement a Spring Boot-based Kafka consumer that has some very strong message delivery guarentees, even in a case of an error.
messages from a partition must be processed in order,
if message processing fails, the consumption of the…

Maciej Papież
- 431
- 1
- 6
- 20
6
votes
2 answers
Set customBackoff for AWS SDK JavaScript V3 retries
I just upgraded to AWS SDK V3 and I have no idea how to configure retryDelayOptions and customBackoff with it. I couldn't find any example code in AWS's own API reference or online. This is what I was doing previously:
retryDelayOptions: {…
6
votes
1 answer
How does the exponential backoff configured in Google Pub/Sub's RetryPolicy work?
The cloud.google.com/go/pubsub library recently released (in v1.5.0, cf. https://github.com/googleapis/google-cloud-go/releases/tag/pubsub%2Fv1.5.0) support for a new RetryPolicy server-side feature. The documentation…

Kurt Peek
- 52,165
- 91
- 301
- 526
4
votes
1 answer
RxJava retryWhen (exponential back-off) not working
So I know this has been asked many times before, but I have tried many things and nothing seems to work.
Let's start with these blogs/articles/code:…

Yuliban
- 143
- 7
4
votes
1 answer
Decorator backoff.on_predicate not waiting as expected
I'm checking the constant interval between calls and found, that in this infinite loop, the time between consecutive calls is not 5 seconds and varies by random, though less than 5 sec. Don't understand, why.
from datetime import datetime
from…

nervous
- 43
- 5
4
votes
1 answer
Does the standard AmazonDynamoDBClient use exponential back off when retrying requests that failed due to a ProvisionedThroughputExceededException?
I've created a standard AmazonDynamoDBClient using the AmazonDynamoDBClientBuilder:
AmazonDynamoDBClient client = AmazonDynamoDBClientBuilder.standard().build();
In the documentation for the AmazonDynamoDBClient, it…

johnnyodonnell
- 1,838
- 3
- 16
- 34
4
votes
2 answers
Polly WaitAndRetryAsync hangs after one retry
I'm using Polly in very basic scenario to do exponential backoff if an HTTP call fails:
protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
return await…

Tudor
- 61,523
- 12
- 102
- 142
4
votes
1 answer
Can a Polly Circuit Breaker have an exponential durationOfBreak?
We are trying to implement a retry policy for our database logic when we receive timeout exceptions due to exhausting the connection pool. This happens when we have a spike of unusually large activity for a small period of time. We have increased…

Mark Brown
- 137
- 10
3
votes
2 answers
Polly C# retry exponentially for 3 tries then switch to retrying every hour
I am trying to use polly to construct a policy that can retry exponentially for n tries and then switch to retrying every 1 hour. Can this be achieved?
I tried policy Wrap but did not get the desired results

eti aggarwal
- 33
- 2
3
votes
1 answer
Is Exponential Backoff inbuilt in AWS SDK Boto3?
I am using Mechanical Turk with Boto3 SDK.
As per the general documentation https://docs.aws.amazon.com/general/latest/gr/api-retries.html , “each AWS SDK implements exponential backoff algorithm” – so why do we need to implement it again in our…

Gadam
- 2,674
- 8
- 37
- 56
3
votes
5 answers
spring reactive retry with exponential backoff conditionally
Using spring reactive WebClient, I consume an API and in case of response with 500 status I need to retry with exponential backoff. But in Mono class, I don't see any retryBackoff with Predicate as input parameter.
This is the kind of function I…

dane131
- 187
- 5
- 16
3
votes
1 answer
How to implement exponential backoff/delay calculation with fixed timeout and number of attempts?
Most backoff/delay algorithms I've seen have fixed number of attempts OR fixed timeout, but not both.
I want to make exactly M attempts within T seconds, with exponential spacing between them, so that "T = delay(0) + delay(1) + ... + delay(M-1)",…

Mike Kazantsev
- 63
- 6
3
votes
3 answers
Exponential Backoff in RxJava
I have an API that takes an Observable that triggers an event.
I want to return an Observable that emits a value every defaultDelay seconds if an Internet connection is detected, and delays numberOfFailedAttempts^2 times if there's no…

Selali Adobor
- 2,060
- 18
- 30