Questions tagged [retry-logic]

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

377 questions
2
votes
1 answer

Polly does not retry even though an exception is caught

I have the following configuration of my HTTP service: services .AddHttpClient((Action) (client => { client.BaseAddress = new Uri(configuration.BaseAddress); client.Timeout =…
mnj
  • 2,539
  • 3
  • 29
  • 58
2
votes
1 answer

Retry logic when a partial update failed

I think that it is a general problem and it is not related with the using technologies. So, please consider the problem itself. I am storing data in Couchbase like below format productId is document id. { "size", "colour", "category", …
2
votes
2 answers

Result - if result has faulted, throw an exception in order to trigger Polly retries

I recently found out about a nuget called LanguageExt.Core and why it is not so efficient to throw exceptions while handling them via middleware or so. Speaking of it, I would like to know what is the best way to simply check if the result has…
Hulkstance
  • 1,323
  • 9
  • 15
2
votes
2 answers

Why is Polly not retrying the exception in my unit test?

I have the following method which has a retriable network call. The retry policy is specified for a specific exception. public async Task GetRecords(MyRequest request) { try { RetryPolicy retryPolicy =…
atprra
  • 114
  • 5
2
votes
1 answer

Polly Retry : System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Flurl.Http.Content.FileContent'

I'm using flurl and polly as part of my code to post asynchronously - I'm having an issue with the retry policy and the file content getting disposed, on a retry the FileContent option has been disposed. I will get the following…
2
votes
1 answer

.Net Core - AWS DynamoDb With Retry Policies

I want to use retry pattern with Aws DynamoDb. I don't know if i can use the Polly package from nuget. I researched a lot, but i learnt how to implement Polly but i couldn't find how to connect Polly with DynamoDb. Is there any way to using Polly…
jack
  • 65
  • 1
  • 6
2
votes
1 answer

How to have dynamic Jittered Back-off for wait and retry in .Net core using polly

I am implementing wait and retry using jitter see below. In the example below the delay is same. How can I make delay dynamic? var delay = Backoff.DecorrelatedJitterBackoffV2(medianFirstRetryDelay: TimeSpan.FromSeconds(1), retryCount: 3); var…
itaustralia
  • 127
  • 1
  • 12
2
votes
2 answers

What is the Correct way of logging before Retry using Polly

I'm attempting to log something before retrying. What is the correct syntax of logging info before retry happens? Here's a sample code similar to my actual code: var policy = Polly.Policy .Handle() .WaitAndRetryAsync( …
Satashree Roy
  • 365
  • 2
  • 9
2
votes
2 answers

Polly RetryForever isn't retrying

I'm, trying to check a simple RetryForever of Polly class Program { public static void Main() { int i = 0; var _retryPolicy = Policy .Handle() .RetryForever(); …
K.W
  • 123
  • 7
2
votes
1 answer

Retrying after a settable delay in Argo Workflows

One of our Argo Workflow steps may hit a rate limit and I want to be able to tell argo how long it should wait until the next retry. Is there a way to do it? I've seen Retries on the documentation but it only talks about retry count and backoff…
Mithir
  • 2,355
  • 2
  • 25
  • 37
2
votes
1 answer

How to add maximum looping in Powershell?

I would like to mapping the network. I need to use retry if the mapping fail, and the maximum retry 5 times. I've tried this way, but I can't figure out how to add the maximum retry. Do{ Try{ $net = new-object -ComObject…
Cheries
  • 834
  • 1
  • 13
  • 32
2
votes
3 answers

Cypress - adding retries to page object

In order to make future changes easier, we have put the login script in a page object. //Login.js export class Login { username_input= () => cy.get('#LoginForm_username'); password_input= () =>…
cypher_null
  • 632
  • 8
  • 22
2
votes
1 answer

How do I add a Polly policy to a Refit Client created with a factory?

I have a refit client (IMyRefitClient) that returns Task> I can't inject this refit client in Program.cs with HostBuilder.ConfigureServices because the url isn't known until runtime. Therefore, I'm using a factory class…
Jack
  • 237
  • 1
  • 4
  • 14
2
votes
1 answer

Adding a load balancer to python request's retry logic?

I am writing a python client that sends requests to our inhouse servers. These requests can go through different connections and need to be somewhat balanced. So far so good, I have the logic to send different requests to alternating backend…
Hans
  • 101
  • 4
2
votes
1 answer

Unit test Polly - Check whether the retry policy is triggered on timeout / error

Problem stmt : I have a service which fetches result from graphql sometime due to server issue the service might throw 500 error Solution: To resolve the above issue I needed to write a retry logic to retry the service when timeout occurs. Obstacle…
devram
  • 105
  • 2
  • 11