Skip to content

Commit

Permalink
retry signal & continue as new
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 committed Apr 12, 2022
1 parent a274580 commit 17a8b12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service/history/historyEngine.go
Expand Up @@ -1953,6 +1953,7 @@ func (e *historyEngineImpl) SignalWorkflowExecution(
WorkflowId: request.WorkflowExecution.WorkflowId,
RunId: request.WorkflowExecution.RunId,
}
currentWorkflow := execution.GetRunId() == ""

return e.updateWorkflow(
ctx,
Expand All @@ -1968,6 +1969,10 @@ func (e *historyEngineImpl) SignalWorkflowExecution(
}

if !mutableState.IsWorkflowExecutionRunning() {
_, status := mutableState.GetWorkflowStateStatus()
if status == enumspb.WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW && currentWorkflow {
return nil, serviceerror.NewUnavailable("try again")
}
return nil, consts.ErrWorkflowCompleted
}

Expand Down

0 comments on commit 17a8b12

Please sign in to comment.