GithubHelp home page GithubHelp logo

Comments (10)

peter-csala avatar peter-csala commented on June 17, 2024 2

You did not specify the ShouldHandle of the RetryStrategyOptions. The default value triggers only for OperationCanceledException. (doc)

from polly.

martincostello avatar martincostello commented on June 17, 2024

Just to "harden" the sample a bit, does the behaviour change or stay the same if you move the counter++; to be the first line of the lambda and change the catch to catch (ArgumentException)?

The would just rule out something else we can't see being thrown causing the test to fail and would also show that the lambda is definitely being called.

from polly.

tomatualus avatar tomatualus commented on June 17, 2024

@martincostello Currently i am unable to reproduce the bug again, so i can't test out your suggestions

But i am 100% sure i did hit debug breakpoints both inside SomeAsyncStuff() and remember seeing ArgumentException as the one being thrown in the console output (before i wrapped it inside try/catch)

from polly.

tomatualus avatar tomatualus commented on June 17, 2024

For additional information - This all started, when i was mocking redis database to throw a RedisTimeoutException, and observed it failing instantly, and not retrying. I tried many fixes, including adding [DebuggerStepThrough] attribute to the method and restarting the IDE. I guess the restart fixed it without me noticing.

Rider Version - 2023.2.3

from polly.

tomatualus avatar tomatualus commented on June 17, 2024

And some SE post i have found with the same issue, but they were using VS and old polly version- https://stackoverflow.com/questions/44057939/exception-user-unhandled-reported-in-vs-debugger-when-using-polly/44079217#44079217

from polly.

tomatualus avatar tomatualus commented on June 17, 2024

You did not specify the ShouldHandle of the RetryStrategyOptions. The default value triggers only for OperationCanceledException. (doc)

But doesn't that mean that any other exception than OperationCanceledException should keep the Retry strategy trying by default?

from polly.

peter-csala avatar peter-csala commented on June 17, 2024

But doesn't that mean that any other exception than OperationCanceledException should keep the Retry strategy trying by default?

In case of Polly we can distinguish two types of exceptions from a strategy perspective: handled exceptions and not handled exceptions.

If the callback / to-be-decorated method throws a handled exception then retry will trigger if the attempt counter did not exceed the threshold. If it exceeded then it will throw the handled exception.

If the callback / to-be-decorated method throws a not handled exception then retry will not trigger just throws the not handled exception.

Old but gold documentation about this: https://github.com/App-vNext/Polly/wiki/Retry#how-polly-retry-works

from polly.

peter-csala avatar peter-csala commented on June 17, 2024

@tomatualus Did we answer your question or do you need further clarification?

from polly.

github-actions avatar github-actions commented on June 17, 2024

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

from polly.

github-actions avatar github-actions commented on June 17, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

from polly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.