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

How to do infinitely retry on exception for CosmosDBTrigger(Or other function trigger) #2925

Closed
blankor1 opened this issue Jan 17, 2025 · 3 comments

Comments

@blankor1
Copy link
Member

Our services are using CosmosDBTrigger in isolated mode and are relying on attributes like [FixedDelayRetry] and [ExponentialBackoffRetry] for retry on exception.

Is it possible the let the CosmosDBTrigger do infinitely retry on exception during the execution? like setting the retry count to -1?

@jviau
Copy link
Contributor

jviau commented Jan 22, 2025

@blankor1 it sounds like you want high levels of resilience for this trigger. If that is the case, I don't recommend relying on retries as many other external factors may lead to even that not being a guarantee (instance crash, scale in, shutdown, etc). Additionally, sometimes there is a fatal error where no matter how many times your trigger retries it will never succeed (did you delete the resource / db / container? lose access? ETag issues?)

For resilience, I recommend looking into durable functions. This will be much more reliable for a distributed application, as it can retry between crashes, restarts, etc.

But to answer your question directly: retry attributes are just a convenience method. If they do not suit your needs (such as indefinite retry), you can look into using something like Polly directly in your trigger.

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

If you are not the original author (blankor1) and believe this issue is not stale, please comment with /bot not-stale and I will not close it.

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

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

No branches or pull requests

2 participants