task_queue_partition_manager.go ×9

Frontier kind: Code frontier

unlabeled · c_b1c0be92e248

12 tests · 4935 LOC · 189 files · introduces 0 tests · 36 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges36 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
948 ranges4935 lines · 189 files · Browse complete extent
All tests (intent)
12 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: 36 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/task_queue_partition_manager.go 33 introduced LOC · 9 ranges

Open complete file

1011 taskID string,
1012 request *matchingservice.QueryWorkflowRequest,
1013 > ) (*matchingservice.QueryWorkflowResponse, error) { task_queue_partition_manager.go
1014 > // TODO(dp): if this partition becomes invalid while the query is blocked, we should cancel the match
1015 > defer pm.sendPartitionCountTrailer(ctx)
1016 > // query counts as "write" for partition load balancing
1017 > if err := pm.checkPartitionCounts(ctx, true); err != nil {
1018 return nil, err
1019 }
1020 > if request.ForwardInfo == nil { task_queue_partition_manager.go
1021 pm.signalPartitionScaler()
1022 }
1023
1024 > task := newInternalQueryTask(taskID, request) task_queue_partition_manager.go
1025 > pm.config.setDefaultPriority(task)
1026 >
1027 > reredirectTask:
1028 > firedNoPollerHook := false
1029 > _, syncMatchQueue, _, _, _, err := pm.getPhysicalQueuesForAdd(ctx,
1030 > request.VersionDirective,
1031 > // We do not pass forwardInfo because we want the parent partition to make fresh versioning decision. Note that
1032 > // forwarded Query/Nexus task requests do not expire rapidly in contrast to forwarded activity/workflow tasks
1033 > // that only try up to 200ms sync-match. Therefore, to prevent blocking the request on the wrong build ID, its
1034 > // more important to allow the parent partition to make a fresh versioning decision in case the child partition
1035 > // did not have up-to-date User Data when selected a dispatch build ID.
1036 > nil,
1037 > request.GetQueryRequest().GetExecution().GetRunId(),
1038 > request.GetQueryRequest().GetExecution().GetWorkflowId(),
1039 > true,
1040 > )
1041 > if err != nil {
1042 return nil, err
1043 }
1046 // Only fire for non-forwarded queries: forwarded queries already had the hook fired
1047 // on the originating partition.
1048 > if request.ForwardInfo == nil && task_queue_partition_manager.go
1049 > !syncMatchQueue.HasPollerAfter(time.Now().Add(-pm.config.WorkerControllerNoPollerHookWindow())) {
1050 queueVersion := syncMatchQueue.QueueKey().Version().WorkerDeploymentVersionS()
1051 pm.processTaskAddHooks(ctx, queueVersion, syncMatchNoPoller)
1053 }
1054
1055 > dbq := pm.defaultQueue() task_queue_partition_manager.go
1056 > if dbq == nil {
1057 return nil, errDefaultQueueNotInit
1058 }
1059 > if dbq != syncMatchQueue { task_queue_partition_manager.go
1060 // default queue should stay alive even if requests go to other queues
1061 dbq.MarkAlive()
1062 }
1063
1064 > res, err := syncMatchQueue.DispatchQueryTask(ctx, task) task_queue_partition_manager.go
1065 > if errors.Is(err, errReprocessTask) {
1066 // We get this if userdata changed while the task was blocked in DispatchQueryTask
1067 goto reredirectTask
1070 // fired a no-poller hook for this query — the two signals are contradictory for
1071 // the same task dispatch.
1072 > if err == nil && res == nil && request.ForwardInfo == nil && !firedNoPollerHook { task_queue_partition_manager.go
1073 queueVersion := syncMatchQueue.QueueKey().Version().WorkerDeploymentVersionS()
1074 pm.processTaskAddHooks(ctx, queueVersion, syncMatchSuccess)
1075 }
1076 > return res, err task_queue_partition_manager.go
1077 }
1078
go.temporal.io/server/service/matching/physical_task_queue_manager.go 3 introduced LOC · 2 ranges

Open complete file

612 ctx context.Context,
613 task *internalTask,
614 > ) (*matchingservice.QueryWorkflowResponse, error) { physical_task_queue_manager.go
615 > if !task.isForwarded() {
616 c.incTaskTracker(c.tasksAdded, priorityKey(task.getPriority().GetPriorityKey()), 1)
617 }
618 > return c.matcher.OfferQuery(ctx, task) physical_task_queue_manager.go
619 }
620