Skip to content

Commit b0e29a0

Browse files
Rollback workflow already completed error (cadence-workflow#4209)
1 parent 68dc1ed commit b0e29a0

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

common/client/versionChecker.go

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func (vc *versionChecker) SupportsRawHistoryQuery(clientImpl string, clientFeatu
176176

177177
// Returns error if workflowAlreadyCompletedError is not supported otherwise nil.
178178
// In case client version lookup fails assume the client does not support feature.
179+
// NOTE: Enabling this error will break customer code handling the workflow errors in their workflow
179180
func (vc *versionChecker) SupportsWorkflowAlreadyCompletedError(clientImpl string, clientFeatureVersion string) error {
180181
return vc.featureSupported(clientImpl, clientFeatureVersion, workflowAlreadyCompletedError)
181182
}

host/signalworkflowTest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (s *IntegrationSuite) TestSignalWorkflow() {
225225
Identity: identity,
226226
})
227227
s.NotNil(err)
228-
s.IsType(&types.WorkflowExecutionAlreadyCompletedError{}, err)
228+
s.IsType(&types.EntityNotExistsError{}, err)
229229
}
230230

231231
func (s *IntegrationSuite) TestSignalWorkflow_DuplicateRequest() {

service/frontend/workflowHandler.go

+3
Original file line numberDiff line numberDiff line change
@@ -4040,6 +4040,8 @@ func checkRequiredDomainDataKVs(requiredDomainDataKeys map[string]interface{}, d
40404040
func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err error) error {
40414041
switch err.(type) {
40424042
case *types.WorkflowExecutionAlreadyCompletedError:
4043+
return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
4044+
/* TODO: re-enable the block below once we can rollout this *breaking* change
40434045
call := yarpc.CallFromContext(ctx)
40444046
clientFeatureVersion := call.Header(common.FeatureVersionHeaderName)
40454047
clientImpl := call.Header(common.ClientImplHeaderName)
@@ -4049,6 +4051,7 @@ func (wh *WorkflowHandler) normalizeVersionedErrors(ctx context.Context, err err
40494051
} else {
40504052
return &types.EntityNotExistsError{Message: "Workflow execution already completed."}
40514053
}
4054+
*/
40524055
default:
40534056
return err
40544057
}

0 commit comments

Comments
 (0)