Skip to content

Commit

Permalink
Rollback workflow already completed error (uber#4209)
Browse files Browse the repository at this point in the history
  • Loading branch information
demirkayaender authored and yux0 committed Jun 1, 2021
1 parent 5ad53e3 commit 0cc2fe3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/client/versionChecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func (vc *versionChecker) SupportsRawHistoryQuery(clientImpl string, clientFeatu

// Returns error if workflowAlreadyCompletedError is not supported otherwise nil.
// In case client version lookup fails assume the client does not support feature.
// NOTE: Enabling this error will break customer code handling the workflow errors in their workflow
func (vc *versionChecker) SupportsWorkflowAlreadyCompletedError(clientImpl string, clientFeatureVersion string) error {
return vc.featureSupported(clientImpl, clientFeatureVersion, workflowAlreadyCompletedError)
}
Expand Down
2 changes: 1 addition & 1 deletion host/signalworkflowTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (s *IntegrationSuite) TestSignalWorkflow() {
Identity: identity,
})
s.NotNil(err)
s.IsType(&types.WorkflowExecutionAlreadyCompletedError{}, err)
s.IsType(&types.EntityNotExistsError{}, err)
}

func (s *IntegrationSuite) TestSignalWorkflow_DuplicateRequest() {
Expand Down
3 changes: 3 additions & 0 deletions service/frontend/workflowHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4159,6 +4159,8 @@ func checkRequiredDomainDataKVs(requiredDomainDataKeys map[string]interface{}, d
func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err error) error {
switch err.(type) {
case *types.WorkflowExecutionAlreadyCompletedError:
return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
/* TODO: re-enable the block below once we can rollout this *breaking* change
call := yarpc.CallFromContext(ctx)
clientFeatureVersion := call.Header(common.FeatureVersionHeaderName)
clientImpl := call.Header(common.ClientImplHeaderName)
Expand All @@ -4168,6 +4170,7 @@ func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err err
} else {
return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
}
*/
default:
return err
}
Expand Down

0 comments on commit 0cc2fe3

Please sign in to comment.