323
// it can't be used here, because timeout timer was not created for it,
324
// because it used to be non-sticky when this transfer task was created .
326
>
327
>
normalTaskQueueName := mutableState.GetExecutionInfo().TaskQueue
328
>
329
>
directive := MakeDirectiveForWorkflowTask(mutableState)
330
>
priority := mutableState.GetExecutionInfo().Priority
331
>
332
>
// NOTE: Do not access mutableState after this lock is released.
333
>
// It is important to release the workflow lock here, because pushWorkflowTask will call matching,
334
>
// which will call history back (with RecordWorkflowTaskStarted), and it will try to get workflow lock again.
335
>
release(nil)
336
>
337
>
err = t.pushWorkflowTask(
338
>
ctx,
339
>
transferTask,
340
>
taskQueue,
341
>
scheduleToStartTimeout.AsDuration(),
342
>
directive,
343
>
priority,
344
>
historyi.TransactionPolicyActive,
345
>
)
346
>
347
>
if _, ok := err.(*serviceerrors.StickyWorkerUnavailable); ok {
348
// sticky worker is unavailable, switch to original normal task queue
349
taskQueue = &taskqueuepb.TaskQueue{