596
}
597
599
>
Name: activityInfo.TaskQueue,
600
>
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
601
>
}
602
>
scheduleToStartTimeout := timestamp.DurationValue(activityInfo.ScheduleToStartTimeout)
603
>
directive := MakeDirectiveForActivityTask(mutableState, activityInfo)
604
>
useWfBuildId := activityInfo.GetUseWorkflowBuildIdInfo() != nil
605
>
priority := priorities.Merge(mutableState.GetExecutionInfo().Priority, activityInfo.Priority)
606
>
607
>
// NOTE: do not access anything related mutable state after this lock release
608
>
release(nil) // release earlier as we don't need the lock anymore
609
>
610
>
resp, err := t.matchingRawClient.AddActivityTask(ctx, &matchingservice.AddActivityTaskRequest{
611
>
NamespaceId: task.GetNamespaceID(),
612
>
Execution: &commonpb.WorkflowExecution{
613
>
WorkflowId: task.GetWorkflowID(),
614
>
RunId: task.GetRunID(),
615
>
},
616
>
TaskQueue: taskQueue,
617
>
ScheduledEventId: task.EventID,
618
>
ScheduleToStartTimeout: durationpb.New(scheduleToStartTimeout),
619
>
Clock: vclock.NewVectorClock(t.shardContext.GetClusterMetadata().GetClusterID(), t.shardContext.GetShardID(), task.TaskID),
620
>
VersionDirective: directive,
621
>
Stamp: task.Stamp,
622
>
Priority: priority,
623
>
})
624
>
if err != nil {
625
return err
626
}
627
629
// activity's build ID is the same as WF's, so no need to update MS
630
return nil
631
}
632
634
>
ctx,
635
>
task,
636
>
resp.AssignedBuildId,
637
>
t.shardContext,
638
>
historyi.TransactionPolicyActive,
639
>
t.cache,
640
>
t.metricsHandler,
641
>
t.logger,
642
>
)
643
}
644