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

Do not fail workflow task if an error occurs when marking it as completed #210

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

christopherb-stripe
Copy link
Contributor

It's possible for a workflow task to fail to complete even during normal operation. For example, if a signal is added to the workflow history concurrently with a workflow task attempting to complete the workflow then the RespondWorkflowTaskCompleted call will recieve an InvalidArgument error with an UnhandledCommand cause.

If this happens then the Ruby SDK would get this error and then try and fail the workflow task due to how the rescue block encompasses the completion function. This would then lead to the RespondWorkflowTaskFailed call failing because the server doesn't recognize the task anymore. This is because the task was actually finalized when the original RespondWorkflowTaskCompleted call was made and so it should not be interacted with anymore.

This PR catches the RespondWorkflowTaskCompleted error sooner (similar to the query branch) so that it does not cause the workflow task to be failed and therefore avoids the Workflow task not found error from the RespondWorkflowTaskFailed call. The error is still logged and passed to the error reporter though.

It's possible for a workflow task to fail to complete even during normal
operation. For example, if a signal is added to the workflow history
concurrently with a workflow task attempting to complete the workflow
then the `RespondWorkflowTaskCompleted` call will recieve an
`InvalidArgument` error with an `UnhandledCommand` cause.

If this happens then the Ruby SDK would get this error and then try and
fail the workflow task due to how the `rescue` block encompassed the
completion function. This would then lead to the
`RespondWorkflowTaskFailed` call failing because the server doesn't
recognize the task anymore. This is because the task was actually
finalized when the original `RespondWorkflowTaskCompleted` call was made
and so it should not be interacted with anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant