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

Handle NextRetryDelay option in workflow failures #5946

Merged
merged 1 commit into from
May 22, 2024
Merged

Conversation

gow
Copy link
Contributor

@gow gow commented May 17, 2024

What changed?

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},
  )

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

@gow gow requested a review from a team as a code owner May 17, 2024 04:59
@gow gow requested review from yycptt and yiminc May 17, 2024 05:01
Copy link
Member

@yycptt yycptt left a 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?

@gow
Copy link
Contributor Author

gow commented May 21, 2024

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?

@gow gow changed the title Handle NextRetryDelay option in workflow task failures Handle NextRetryDelay option in workflow failures May 22, 2024
@gow
Copy link
Contributor Author

gow commented May 22, 2024

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.

@gow gow merged commit 20623c9 into main May 22, 2024
42 checks passed
@gow gow deleted the cg_next_retry_delay branch May 22, 2024 21:42
stephanos pushed a commit that referenced this pull request Jun 13, 2024
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
dandavison added a commit to dandavison/temporalio-sdk-typescript that referenced this pull request Jul 10, 2024
dandavison added a commit to dandavison/temporalio-sdk-python that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants