Questions tagged [retry-logic]

Programming techniques designed to retry operations that failed due to error codes, exceptions, or other language specific means.

377 questions
0
votes
1 answer

Can a SSLHandshakeException be a retry-able exception?

I have a service-to-service connection that is intermittently throwing SSLHandshakeExceptions from a jersey client. public static class MyClientFilter extends ClientFilter{ @Override public ClientResponse handle(ClientRequest cr) throws…
one stevy boi
  • 577
  • 6
  • 24
0
votes
2 answers

How do I use Polly for retries and transient fault handling of arbitrary "failure" conditions

I want to use Polly not to check for overt "failures" but rather for other conditions. Specifically, I want to make a single (async) call, for example httpClient.GetAsync(...) which for the purposes of this question I know will succeed - that is,…
Howiecamp
  • 2,981
  • 6
  • 38
  • 59
0
votes
1 answer

Retry (resubscribe) to source observable if no next(...) call within a timeout

I am trying to take a rxjs source observable, representing a network connection that pushes me data, and reconnect (by resubscribing to the source observable) if I have not received data within a timeout period. I can certainly write this in a…
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
0
votes
1 answer

Retry Logic - retry whole class if one tests fails - selenium

Following are the classes used to implement retry logic TestRetry Class: public class TestRetry implements IRetryAnalyzer { int counter=0; int retryLimit=2; @Override public boolean retry(ITestResult result) { if (counter <…
0
votes
2 answers

Inoperation of testng Retry Analyzer

I was following several different Web Sites explaining how to use RetryAnalyzer (they all say basically the same thing, but I checked several to see whether there was any difference). I implemented as they did in the samples, and deliberately…
Tony
  • 1,127
  • 1
  • 18
  • 29
0
votes
0 answers

Combination of dependsOnMethods or dependsOnGroups and RetryAnalyzer

When a test fails and then passes after retry using IRetryAnalyzer implementation, all dependent tests are skipped. I tried removing failed and skipped tests results as noted below but it still doesn't seem to work. @Override public boolean…
Steven
  • 1
0
votes
1 answer

Retry after catch

Here's the logic I used: int retries = config.get("retries"); Response resp = null do { try { resp = operation.execute(); retries = 0; } catch (Exception ex) { //Note. Please excuse this catch pattern. Its not a problem now. …
xploreraj
  • 3,792
  • 12
  • 33
  • 51
0
votes
1 answer

How to use SetRequestCoordinator from Pathoschild lib?

I set on purpose the timeout very low to make the http call crash in order to test the retry feature but an exception is raised so the httpClient didn't retry the previous request. I thought at first that only if after some attempts configured by…
onepix
  • 289
  • 2
  • 11
0
votes
1 answer

Composing a Polly Policy with user feedback

There are several policy's that need to be the same throughout my code. For example: var myIOProblems = Policy .Handle() .WaitAndRetryForever(i => TimeSpan.FromSeconds(2)); Then I'll have some code that will do the…
Gordon
  • 3,012
  • 2
  • 26
  • 35
-1
votes
2 answers

Creating Polly retry policy creation for HTTP Transient exception

I am trying to implement polly retry for a method for http transient exception but i am stuck on issues here is the situation CustomResponse response = getResponse(CustomRequest request) getResponse has 2 implemtation one using wcf another using…
User123
  • 19
  • 3
-1
votes
2 answers

Polly Retry with HTTP Client is exceeding the Number of Max Retries and continues Retry till HTTP Timeout Occurred

I have defined some Typed API Client via Dependency Injection in Start up like below. public void ConfigureHttpClients(IServiceCollection services) { services.AddHttpClient() …
-1
votes
1 answer

What would be a default implementation of Polly on GraphServiceClient with DI?

I'm trying to find an easy way to implement Polly on my GraphServiceClient using DI. I have my GraphApiBuilder class that I use to interface with any class that needs the GraphServiceClient since injecting it directly in a class with hard logic…
-1
votes
2 answers

How do I implement retries for WCF clients?

I have a C# client implementing System.ServiceModel.ClientBase for communication with a SOAP API. I want the client to automatically retry requests when timeouts occur. I figure I could use a library like Polly to create an HttpClient…
br3nt
  • 9,017
  • 3
  • 42
  • 63
-1
votes
1 answer

Retry Refit request with Polly only on condition

I set up the following service collection with a Refit client and a Polly policy for dependency injection in my UWP app: var serviceCollection = new ServiceCollection(); serviceCollection .AddRefitClient(typeof(IClassevivaAPI)) …
Gabboxl
  • 91
  • 3
  • 16
-1
votes
1 answer

"Unable to resolve service for type 'Polly.IAsyncPolicy' while attempting to activate 'SqlDapperClient'."

I have an ASP.NET Core 3.1 Web API project which is leveraging Dapper for database operations. In this case I am trying to leverage Polly to to add resiliency to the methods that are connecting to the database while fetching the data. I referenced…
santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143