-
Notifications
You must be signed in to change notification settings - Fork 783
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
Handle NextRetryDelay option in workflow failures #5946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only for handling the failure of the first attempt of the workflow task?
No. It's meant to handle failure with NextRetryDelay in any attempt of the workflow task. What gave you the impression that it's applied only to the first attempt? |
Synced offline. The confusion was me calling it "workflow task" which is a different construct than the workflow code (or simply workflow). This change works as intended for the workflows where it can return an application error to customize its next retry delay. |
Workflows can now return an application error with NextRetryDelay option to customize when the workflow will be retried again. ``` return temporal.NewApplicationError( "some retryable error", "SomeType", temporal.ApplicationErrorOptions{NextRetryDelay: 2 * time.Minute}, ) ``` Currently Activity tasks can customize the next retry time. This is bringing the same feature to workflow tasks as well. Added unit tests. Also added a test to assert next retry delay customization in activities. <!-- Assuming the worst case, what can be broken when deploying this change to production? --> <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> No
What changed?
Workflows can now return an application error with NextRetryDelay option to customize when the workflow will be retried again.
Why?
Currently Activity tasks can customize the next retry time. This is bringing the same feature to workflow tasks as well.
How did you test it?
Added unit tests.
Also added a test to assert next retry delay customization in activities.
Potential risks
Documentation
Is hotfix candidate?
No