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
0 answers

Scala pattern matching - Identify between connection(infra) exception and data(Query) exception in Java.Sql

I am trying to find ways to write a code for retry only for connection exception. But every exception from Sql server is under SQLSERVEREXCEPTION. Is there any way to differentiate connection exception from others. //code idea val result =…
0
votes
1 answer

REDUX SAGA - API Retry Isomorphic Fetch

I am trying to add RETRY Logic in the context of - I make an API call -> response is 401 -> I invoke APi to request for a NEW Token in the background. The poin there si MY API Calls shouldnt fail. Following is my API File (This is common - Every API…
Gauri Padbidri
  • 371
  • 4
  • 15
0
votes
1 answer

Retry strategy/framework for doing retry on result for failed insertions

I'm making a service call with some input objects to a database. Few of the objects succeed and rest of them fail with a reason. I want to have an exponential retry strategy to trigger the same call with the failed objects. Is there any framework i…
samuel koduri
  • 389
  • 2
  • 4
  • 9
0
votes
1 answer

How can I retry a URLRequest.sharedDataTask until the response is 200?

I am new to Swift and currently stuck on exiting a function containing shared.dataTask once the httpResponse is 200. Any suggestions will be appreciated. func retryFunc(url: String, requestType: String, requestJsonData: Any, retriesLeft: Int) { …
Ozone17
  • 138
  • 7
0
votes
1 answer

Is there any way to retry different in method when a particular method failing (instead of retrying that failed method)

I have a requirement in which I have 2 methods (in different class) , in which one method makes Rest GET call to fetch token(which is like session token and valid for few seconds) and another method which append this retrieved token in headers and…
Priya
  • 143
  • 4
  • 17
0
votes
1 answer

How do the [Retry] and [Repeat] attributes interact, in NUnit

[Retry] will re-run the test if it fails, and only fail if ALL runs fail. [Repeat] will re-run the test if it passes, and only pass if ALL runs pass. So ... what's the expected behaviour if you attach both attributes? Which attribute is on the…
Brondahl
  • 7,402
  • 5
  • 45
  • 74
0
votes
1 answer

Unit Tests for Retry Decoration method Python Nosetest

I have a retry funtion in my code. def retry(retry_times=4, wait_time=1): """ Function to use as a decorator to retry any method certain number of times :param retry_times: number of times to retry a function :param wait_time: delay between each…
0
votes
1 answer

Starting with Polly basics

I'm pretty new with Polly and I'm trying to understand how works, starting from the very basics. To test the retries I tried to create a code (Print) that has 33% to generate a DivideByZeroException. When the error is generated it raise up to…
user1812102
  • 51
  • 1
  • 6
0
votes
1 answer

Django/Docker-compose: Retry Database Connection when: django.db.utils.OperationalError: (2002, "Can't connect to MySQL server on 'db' (115)")

This question have been asked here: django.db.utils.OperationalError: (2002, "Can't connect to MySQL server on 'db' (115)") and the answer has been to wait for the database to be ready. However, the official documentation here:…
Fabio Magarelli
  • 1,031
  • 4
  • 14
  • 47
0
votes
2 answers

Polly retry based on Service Bus message retry count

My current understanding is that Polly will retry the code to execute based on the policy defined. What I would like to do is to have Polly work based on a ServiceBus message, so I'd provide the retry count to Polly and it would choose the…
Peter Morris
  • 20,174
  • 9
  • 81
  • 146
0
votes
0 answers

c# HttpRequestException: Error while copying content to a stream in HttpMessageHandler

Using a custom RetryHandler in .NET for HttpClient. //Create client var client = new HttpClient(new RetryHandler(new HttpClientHandler())); //PutAsync var result = await client.PutAsync(new Uri($"{fileSystem}?resource=filesystem"),…
Sky W
  • 1
  • 2
0
votes
1 answer

add wait period before each retry in my scala code

I have a spark connector notebook, "Export Tables To Database", that write spark table data to an Azure SQL database. I have a master notebook that calls that spark connector notebook to write many tables in parallel. If a copy fails, I have a retry…
Dung Tran
  • 357
  • 1
  • 2
  • 13
0
votes
1 answer

Resolve known exceptions and re-execute same function or code which causes it, until (if) it resolves automatically in JAVA

For instance:- a method to divide public static void divide( int a, int b) { return a/b; // This would throw ArithmeticException / by 0. whenever b ==0; } if b is dynamic input and let's say changes with time. and i want to get a value from this…
Maddy
  • 29
  • 6
0
votes
1 answer

Retry the task without sleep or blocking thread

I want to have a retry mechanism where if a task is failed and it should be retried after an interval without blocking or sleeping any thread. For example, lets assume I have maxRetryAttempt as 3 and interval between retry is 3 seconds. I have list…
Raashith
  • 155
  • 3
  • 16
0
votes
2 answers

Retry a command only once : when a command fails (in bash)

for ( i=3; i<5; i++) do execute some command 1 if command 2 is successful then do not run the command 1 (the for loop should continue) if command 2 is not successful then run command 1 only once (like retry command 1 only once, after…