@@ -817,10 +817,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandContinueAsNewWorkflow(
817
817
namespaceName .String (),
818
818
)
819
819
if err != nil {
820
- handler .stopProcessing = true
821
- return err
820
+ return handler .failWorkflowTaskOnInvalidArgument (enumspb .WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES , err )
822
821
}
823
822
if unaliasedSas != nil {
823
+ // Create a shallow copy of the `attr` to avoid modification of original `attr`,
824
+ // which can be needed again in case of retry.
824
825
newAttr := * attr
825
826
newAttr .SearchAttributes = unaliasedSas
826
827
attr = & newAttr
@@ -928,10 +929,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandStartChildWorkflow(
928
929
targetNamespace .String (),
929
930
)
930
931
if err != nil {
931
- handler .stopProcessing = true
932
- return err
932
+ return handler .failWorkflowTaskOnInvalidArgument (enumspb .WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES , err )
933
933
}
934
934
if unaliasedSas != nil {
935
+ // Create a shallow copy of the `attr` to avoid modification of original `attr`,
936
+ // which can be needed again in case of retry.
935
937
newAttr := * attr
936
938
newAttr .SearchAttributes = unaliasedSas
937
939
attr = & newAttr
@@ -1072,10 +1074,11 @@ func (handler *workflowTaskHandlerImpl) handleCommandUpsertWorkflowSearchAttribu
1072
1074
namespace .String (),
1073
1075
)
1074
1076
if err != nil {
1075
- handler .stopProcessing = true
1076
- return err
1077
+ return handler .failWorkflowTaskOnInvalidArgument (enumspb .WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES , err )
1077
1078
}
1078
1079
if unaliasedSas != nil {
1080
+ // Create a shallow copy of the `attr` to avoid modification of original `attr`,
1081
+ // which can be needed again in case of retry.
1079
1082
newAttr := * attr
1080
1083
newAttr .SearchAttributes = unaliasedSas
1081
1084
attr = & newAttr
0 commit comments