887
task *internalTask,
888
backlogQueue *PhysicalTaskQueueKey,
890
>
taskInfo := task.event.GetData()
891
>
// This task came from taskReader so task.event is always set here.
892
>
directive := taskInfo.GetVersionDirective()
893
>
assignedBuildId := backlogQueue.Version().BuildId()
894
>
if assignedBuildId != "" {
895
// construct directive based on the build ID of the spool queue
896
directive = worker_versioning.MakeBuildIdDirective(assignedBuildId)
897
}
898
// Redirect and re-resolve if we're blocked in matcher and user data changes.
900
>
newBacklogQueue, syncMatchQueue, userDataChanged, taskDispatchRevisionNumber, targetVersion, err := pm.getPhysicalQueuesForAdd(ctx,
901
>
directive,
902
>
nil,
903
>
taskInfo.GetRunId(),
904
>
taskInfo.GetWorkflowId(),
905
>
false)
906
>
if err != nil {
907
return err
908
}
909
911
>
912
>
// Update the task dispatch revision number on the task since the routingConfig of the partition
913
>
// may have changed after the task was spooled.
914
>
task.taskDispatchRevisionNumber = taskDispatchRevisionNumber
915
>
916
>
// set redirect info if spoolQueue and syncMatchQueue build ids are different
917
>
if assignedBuildId != syncMatchQueue.QueueKey().Version().BuildId() {
918
task.redirectInfo = &taskqueuespb.BuildIdRedirectInfo{
919
AssignedBuildId: assignedBuildId,
920
}
922
// make sure to reset redirectInfo in case it was set in a previous loop cycle
923
task.redirectInfo = nil
924
}
926
// Backlog queue has changed, spool to the new queue. This should happen rarely: when
927
// activity of pinned workflow was determined independent and sent to the default queue