Skip to content

Commit 7497119

Browse files
committed
Do not add start WFT before processing commands
1 parent 352934a commit 7497119

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

service/history/api/respondworkflowtaskcompleted/api.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,10 @@ func (handler *WorkflowTaskCompletedHandler) Invoke(
476476
if request.GetForceCreateNewWorkflowTask() || // Heartbeat WT is always of Normal type.
477477
wtFailedShouldCreateNewTask ||
478478
hasBufferedEventsOrMessages ||
479-
activityNotStartedCancelled {
479+
activityNotStartedCancelled ||
480+
// If the workflow has an ongoing transition to another deployment version, we should ensure
481+
// it has a pending wft so it does not remain in the transition phase for long.
482+
ms.GetDeploymentTransition() != nil {
480483

481484
newWorkflowTaskType = enumsspb.WORKFLOW_TASK_TYPE_NORMAL
482485

service/history/workflow/workflow_task_state_machine.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,16 +1129,6 @@ func (m *workflowTaskStateMachine) afterAddWorkflowTaskCompletedEvent(
11291129
}
11301130
}
11311131

1132-
if transition != nil {
1133-
// There is still a transition going on. We need to schedule a new WFT so it goes to the
1134-
// transition deployment this time.
1135-
if _, err := m.ms.AddWorkflowTaskScheduledEvent(
1136-
false,
1137-
enumsspb.WORKFLOW_TASK_TYPE_NORMAL,
1138-
); err != nil {
1139-
return err
1140-
}
1141-
}
11421132
// Deployment and behavior before applying the data came from the completed wft.
11431133
wfDeploymentBefore := m.ms.GetEffectiveDeployment()
11441134
wfBehaviorBefore := m.ms.GetEffectiveVersioningBehavior()

0 commit comments

Comments
 (0)