temporalio / temporalio/temporal
Application Error with a Suggested Retry Interval Duration
@gow is already working on this.
Since Apr 26, 2024.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
Given an activity that calls a third-party service to perform a rate limited action, we return an application error when encountering a rate-limit response. Sometimes, the third-party rate limit suggestion is to NOT make another call for X-period of time which is dynamic (e.g. 5s to 90s).
Describe the solution you'd like
It would be nice if the application error could also hold a retry interval value so that the Temporal server would not schedule the activity retry until such time has elapse.
Describe alternatives you've considered
1- Set the activity's RetryPolicy.InitialInterval to the max X-period expected. This is bad because the activity is waiting too long before retrying.
or
2- Use a non-retryable application error and add details to it to then in the workflow make a timer and then retry the call. This bad for many reasons (not listed here because they are probably obvious).
or
3- Don't return an error. Have the activity handle the retrying by waiting and then trying again. This is bad because we're reinventing a feature that's a first-class citizen in Temporal. Additionally, it will take up an active activity slot.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.