1131
) {
1132
if m.HasStartedWorkflowTask() && workflowTask.StartedEventID == common.EmptyEventID {
1134
>
// 1. workflow task completed:
1135
>
// a. workflow task contains close workflow command, the fact that workflow task
1136
>
// completes successfully means workflow will also close and the value of the
1137
>
// flag doesn't matter.
1138
>
// b. workflow task doesn't contain close workflow command, then by definition,
1139
>
// workflow is not trying to close, so unset the flag.
1140
>
// 2. workflow task timedout: we don't know if workflow is trying to close or not,
1141
>
// reset the flag to be safe. It's possible that workflow task is trying to signal
1142
>
// itself within a local activity when this flag is set, which may result in timeout.
1143
>
// reset the flag will allow the workflow to proceed.
1144
>
// 3. workflow failed: always reset the flag here. If failure is due to unhandled command,
1145
>
// AddWorkflowTaskFailedEvent will set the flag.
1146
>
m.ms.workflowCloseAttempted = false
1147
>
}
1148
1149
m.ms.executionInfo.WorkflowTaskVersion = workflowTask.Version