Programming techniques designed to retry operations that failed due to error codes, exceptions, or other language specific means.
Questions tagged [retry-logic]
377 questions
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
What is the default retry policy mechanism OKHttp? (Android)
I have been trying to find an answer for this one and could not find any.
There are many techniques where we can implement retry in OkHttp with retrofit and also configure it
As per the document…

Sathish
- 459
- 6
- 12
6
votes
1 answer
How to test Retry attempts in python using the request library
I have the following:
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
retry_strategy = Retry(
total=3,
status_forcelist=[429, 500, 502, 503, 504],
method_whitelist=["HEAD", "GET",…

Alexander Knight Room
- 123
- 8
6
votes
2 answers
How to customize http.Client or http.Transport in Go to retry after timeout?
I want to implement a custom http.Transport for standard http.Client, which will retry automatically if the client got timeout.
P.S. for some reason, the custom http.Transport is a must-have. I've already checked hashicorp/go-retryablehttp, however…

Hyori
- 166
- 1
- 8
6
votes
2 answers
Polly Retry policy with Function is not waiting for result
I am trying to convert my existing function to Polly Retry policy
public static T Execute(Func getTask) where T : Task
{
var retryCount = 3;
while (retryCount-- > 0)
{
try
{
getTask().Wait();
…

RaceBase
- 18,428
- 47
- 141
- 202
5
votes
3 answers
How do you obtain underlying failed request data when catching requests.exceptions.RetryError?
I am using a somewhat standard pattern for putting retry behavior around requests requests in Python,
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
retry_strategy = Retry(
…

ely
- 74,674
- 34
- 147
- 228
5
votes
1 answer
Polly HandleTransientHttpError not catching HttpRequestException
I've created a retry policy on my HttpClient in the Startup.ConfigureServices method. Note also that by default, asp.net core 2.1 logs 4 [Information] lines for each call made by the HttpClient which are shows in the logs at the end of my…

SeanOB
- 752
- 5
- 24
5
votes
1 answer
What is the best order to apply multiple Polly policies?
The order in which Polly policies are encapsulated change the final result. Which is the best order if I want to use the following policies? This is the best order I could think of: the retries should be submitted to the bulkhead limits, and the…

Alessandra Anyzewski
- 59
- 3
5
votes
3 answers
Using exponential backoff in Polly Library with httpclient
I just read about Polly library and I need to handle 3 retries when communicating from a desktop agent to a server.
Currently I like the exponential backoff.
However, I struggle to understand how to implement this in my code. This is what I have…

grozdeto
- 1,201
- 1
- 13
- 34
5
votes
2 answers
Polly -how do I log final error and continue?
I'm trying to set up Polly in .Net Core 3.1 (Azure Functions v3).
I want to create a Policy in the Startup class which I can inject into functions.
The behaviour that I'm looking for is:
It should wait And retry 3 times - if the final try fails -…

PSXYU
- 101
- 2
- 8
5
votes
1 answer
Polly retry with different url
I am trying to create a solution with polly where I request an other api.
I have a list of URLs to multiple instances of the same service.
I want that when the first request failes, an other should automaticly start with the next url from my…

csk
- 73
- 1
- 7
5
votes
2 answers
Retry stream in akka on failure of any stage in flow
I am using akka stream to process my data. In which I have 1 Source which consists of element UUID.
The flow is as follows :
is fetching the Element from some third party HTTP service which returns complete Element with its properties.
Then I…

Ajinkya
- 125
- 7
4
votes
2 answers
Polly rate limiting too early
I'm trying to get my head around Polly rate-limit policy.
public class RateLimiter
{
private readonly AsyncRateLimitPolicy _throttlingPolicy;
private readonly Action _rateLimitedAction;
public RateLimiter(int numberOfExecutions,…

Arthur Rey
- 2,990
- 3
- 19
- 42
4
votes
2 answers
RateLimiting - Incorrect limiting
I have a RabbitMQ Queue, filled with thousands of messages. I need my consumer to consume 1 message per second, so I have implemented a RateLimit policy using Polly. My configuration is as follows:
public static IAsyncPolicy GetPolicy(int mps)
{
…

Katia S.
- 197
- 2
- 13
4
votes
2 answers
Polly patterns in C# for a workflow?
I have a workflow like this:
call an API method
if any exception is thrown but timeout, the program logs that exception and throws it.
if timeout is thrown, the program has to call another API method.
after calling another API method, if…

Nega
- 119
- 8