Skip to content

Commit

Permalink
Check identity length before RespondDecisionTaskCompleted to history (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored May 24, 2021
1 parent 7e333a8 commit edfb9ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions service/frontend/workflowHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1564,20 +1564,20 @@ func (wh *WorkflowHandler) RespondDecisionTaskCompleted(
return nil, errShuttingDown
}

histResp, err := wh.GetHistoryClient().RespondDecisionTaskCompleted(ctx, &types.HistoryRespondDecisionTaskCompletedRequest{
DomainUUID: taskToken.DomainID,
CompleteRequest: completeRequest},
)
if err != nil {
return nil, wh.error(err, scope)
}

if !common.ValidIDLength(
completeRequest.GetIdentity(),
scope,
wh.config.MaxIDLengthWarnLimit(),
wh.config.IdentityMaxLength(domainName),
metrics.CadenceErrIdentityExceededWarnLimit) {
return nil, wh.error(errIdentityTooLong, scope)
}

histResp, err := wh.GetHistoryClient().RespondDecisionTaskCompleted(ctx, &types.HistoryRespondDecisionTaskCompletedRequest{
DomainUUID: taskToken.DomainID,
CompleteRequest: completeRequest},
)
if err != nil {
return nil, wh.normalizeVersionedErrors(ctx, wh.error(err, scope))
}

Expand Down

0 comments on commit edfb9ed

Please sign in to comment.