task_queue_partition_manager.go ×6

Frontier kind: Code frontier

unlabeled · c_9376081f8f39

86 tests · 4114 LOC · 184 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
725 ranges4114 lines · 184 files · Browse complete extent
All tests (intent)
86 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 32 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/task_queue_partition_manager.go 26 introduced LOC · 6 ranges

Open complete file

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
910 > task.targetWorkerDeploymentVersion = targetVersion task_queue_partition_manager.go
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 }
925 > if !backlogQueue.version.Deployment().Equal(newBacklogQueue.QueueKey().version.Deployment()) { task_queue_partition_manager.go
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
939 return nil
940 }
941 > err = syncMatchQueue.DispatchSpooledTask(ctx, task, userDataChanged) task_queue_partition_manager.go
942 > if err != errInterrupted {
943 return err
944 }
go.temporal.io/server/service/matching/physical_task_queue_manager.go 6 introduced LOC · 4 ranges

Open complete file

567 task *internalTask,
568 userDataChanged <-chan struct{},
570 > if c.oldMatcher == nil {
571 return softassert.UnexpectedInternalErr(c.logger, "DispatchSpooledTask called on new matcher", nil)
572 }
573 > return c.oldMatcher.MustOffer(ctx, task, userDataChanged) physical_task_queue_manager.go
574 }
575
578 ctx context.Context,
579 task *internalTask,
581 > if !c.taskValidator.maybeValidate(task.event.AllocatedTaskInfo, c.queue.TaskType()) {
582 task.finish(taskFinishResult{dropReason: getDroppedTaskExpiryReason(task)})
583 // Don't try to set read level here because it may have been advanced already.