Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RetryPolicy.Handle Property to Allow for Exception Filtering on Retries #314

Merged
merged 11 commits into from
Jun 3, 2024

Conversation

tomseida
Copy link
Contributor

Add Handle delegate property to RetryPolicy and ensure it is passed to CoreRetryOptions so users of RetryPOlicy have ability to determine retry policy based on exception,

Testing shows it correctly constrains the number of times the task is called, but the check for the number of times the Handle method is called does not meet expectations. The Handle method is being invoked many more times than the task .

Tom Seida added 3 commits May 20, 2024 18:52
…o CoreRetryOptions.

Testing shows it constrains the number of times teh task is called, but the check for the number of times the Handle method is called does not meet expectations. The Handle method is being invoked many more times than the task .
@tomseida
Copy link
Contributor Author

@cgillum, any timeline for reviewing the changes I made based on your comment?

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small things from me. @jviau, could you take a look as well?

src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with these changes.

src/Abstractions/RetryPolicy.cs Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
Add attributes to RetryPolicy.Handle property.
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Outdated Show resolved Hide resolved
src/Abstractions/RetryPolicy.cs Show resolved Hide resolved
Handle: remove Obsolete attribute and add to summary.
@cgillum cgillum merged commit 90bd3fe into microsoft:main Jun 3, 2024
2 checks passed
@Kobudzik
Copy link

Hello, is there any approximate date when will this be released?

@cgillum
Copy link
Member

cgillum commented Jul 26, 2024

@jviau or @davidmrdavid, when is the next planned release of the .NET Isolated SDK?

@tomseida
Copy link
Contributor Author

I have been monitoring nuget for updates. Once there is a prerelease, I will perform some additional testing. Also hoping the Schedule orchestration feature fix is also in the next release.

@Fazer01
Copy link

Fazer01 commented Aug 13, 2024

Aah, we also would love the feature introduced with this PR. Awaiting new release. Any ETA on this? @jviau @tomseida?

@tomseida
Copy link
Contributor Author

Aah, we also would love the feature introduced with this PR. Awaiting new release. Any ETA on this? @jviau @tomseida?

I have been checking twice a week to start using these changes. Not sure what's the hold-up. Would think at least a pre-release would be available.

@tomseida
Copy link
Contributor Author

tomseida commented Sep 3, 2024

@cgillum, any update on a release date? Odd that it has been over 3 months since the PR was completed and nothing has been made available.

@cgillum
Copy link
Member

cgillum commented Sep 3, 2024

I believe @jviau is still on leave until the end of this month. @davidmrdavid, @AnatoliB, or @lilyjma can we come up with a plan for updating the .NET Isolated release in the meantime?

@davidmrdavid
Copy link
Member

Should be out now: https://github.com/Azure/azure-functions-durable-extension/releases/tag/v1.1.6-worker-extension

@tomseida
Copy link
Contributor Author

I tested the new nuget packages and the HandleFailure method worked for me. Thanks for finally get this released. Will save on unnecessary compute.
image

@Kobudzik
Copy link

Kobudzik commented Oct 1, 2024

@cgillum Is there any reason why TaskFailureDetails are used as Func argument? I want to retry on two types of transient errors:

  • when SqlServerTransientExceptionDetector.ShouldRetryOn(Exception ex) resolves true
  • when exception is ApiException with status code 400/401/404

With current implementation it cannot be achieved as far as I know. Would it make sense to e.g. serialize the original Exception within TaskFailureDetails? Or if TaskFailureDetails shouldn't grow much, maybe there should be some other flow?

public Func<Exception, Task<bool>>? HandleAsync { get; set; }

This non-implemented function would fit more or less on my use case, is there any particular reason why wasn't it implemented?

@cgillum
Copy link
Member

cgillum commented Oct 1, 2024

Hi @Kobudzik. I think your question(s) might be best to have in a separate GitHub issue since they don’t appear to be simple. Please create an issue and feel free to tag me there. That way we can go into more details without automatically notifying all the participants in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants