Skip to content

Commit 25a4b89

Browse files
committed
bypass activity task generation if paused
1 parent 778939d commit 25a4b89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

service/history/api/respondworkflowtaskcompleted/workflow_task_completed_handler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,12 @@ func (handler *workflowTaskCompletedHandler) handleCommandScheduleActivity(
505505
eagerStartActivity := attr.RequestEagerExecution && handler.config.EnableActivityEagerExecution(namespace) &&
506506
(!versioningUsed || attr.UseWorkflowBuildId)
507507

508+
// we bypass activity task generation if either eagerStartActivity is true or the workflow is paused.
509+
bypassTaskGeneration := eagerStartActivity || (handler.mutableState.GetExecutionState().Status == enumspb.WORKFLOW_EXECUTION_STATUS_PAUSED)
508510
event, _, err := handler.mutableState.AddActivityTaskScheduledEvent(
509511
handler.workflowTaskCompletedID,
510512
attr,
511-
eagerStartActivity,
513+
bypassTaskGeneration,
512514
)
513515
if err != nil {
514516
return nil, nil, handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID, err)

0 commit comments

Comments
 (0)