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

Fail workflow task with BadSearchAttributes cause if search attributes mapper returned an error #3919

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions service/history/workflowTaskHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandContinueAsNewWorkflow(
namespaceName.String(),
)
if err != nil {
handler.stopProcessing = true
return err
return handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES, err)
}
if unaliasedSas != nil {
// Create a shallow copy of the `attr` to avoid modification of original `attr`,
// which can be needed again in case of retry.
newAttr := *attr
newAttr.SearchAttributes = unaliasedSas
attr = &newAttr
Expand Down Expand Up @@ -928,10 +929,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandStartChildWorkflow(
targetNamespace.String(),
)
if err != nil {
handler.stopProcessing = true
return err
return handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES, err)
}
if unaliasedSas != nil {
// Create a shallow copy of the `attr` to avoid modification of original `attr`,
// which can be needed again in case of retry.
newAttr := *attr
newAttr.SearchAttributes = unaliasedSas
attr = &newAttr
Expand Down Expand Up @@ -1072,10 +1074,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandUpsertWorkflowSearchAttribu
namespace.String(),
)
if err != nil {
handler.stopProcessing = true
return err
return handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES, err)
}
if unaliasedSas != nil {
// Create a shallow copy of the `attr` to avoid modification of original `attr`,
// which can be needed again in case of retry.
newAttr := *attr
newAttr.SearchAttributes = unaliasedSas
attr = &newAttr
Expand Down