visibility_queue_task_executor.go ×9

Frontier kind: Code frontier

unlabeled · c_665d1e2a0024

11 tests · 6890 LOC · 220 files · introduces 0 tests · 43 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges43 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1390 ranges6890 lines · 220 files · Browse complete extent
All tests (intent)
11 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.

3 files ranked by introduced lines: 43 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/visibility_queue_task_executor.go 38 introduced LOC · 9 ranges

Open complete file

105 var err error
106 switch task := task.(type) {
107 > case *tasks.StartExecutionVisibilityTask: visibility_queue_task_executor.go
108 > err = t.processStartExecution(ctx, task)
109 case *tasks.UpsertExecutionVisibilityTask:
110 err = t.processUpsertExecution(ctx, task)
130 ctx context.Context,
131 task *tasks.StartExecutionVisibilityTask,
132 > ) (retError error) { visibility_queue_task_executor.go
133 > ctx, cancel := context.WithTimeout(ctx, taskTimeout)
134 > defer cancel()
135 >
136 > namespaceEntry, err := t.shardContext.GetNamespaceRegistry().
137 > GetNamespaceByID(namespace.ID(task.GetNamespaceID()))
138 > if err != nil {
139 return err
140 }
141
142 > weContext, release, err := getWorkflowExecutionContextForTask(ctx, t.shardContext, t.cache, task) visibility_queue_task_executor.go
143 > if err != nil {
144 return err
145 }
146 > defer func() { release(retError) }() visibility_queue_task_executor.go
147
148 > mutableState, err := weContext.LoadMutableState(ctx, t.shardContext) visibility_queue_task_executor.go
149 > if err != nil {
150 return err
151 }
152 > if mutableState == nil || !mutableState.IsWorkflowExecutionRunning() { visibility_queue_task_executor.go
153 return nil
154 }
156 // verify task version for RecordWorkflowStarted.
157 // upsert doesn't require verifyTask, because it is just a sync of mutableState.
158 > startVersion, err := mutableState.GetStartVersion() visibility_queue_task_executor.go
159 > if err != nil {
160 return err
161 }
162 > err = CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), startVersion, task.Version, task) visibility_queue_task_executor.go
163 > if err != nil {
164 return err
165 }
166
167 > requestBase := t.getVisibilityRequestBase( visibility_queue_task_executor.go
168 > task,
169 > namespaceEntry,
170 > mutableState,
171 > mutableState.GetExecutionInfo().Memo,
172 > mutableState.GetExecutionInfo().SearchAttributes,
173 > )
174 >
175 > // NOTE: do not access anything related mutable state after this lock release
176 > // release the context lock since we no longer need mutable state and
177 > // the rest of logic is making RPC call, which takes time.
178 > release(nil)
179 >
180 > return t.visibilityMgr.RecordWorkflowExecutionStarted(
181 > ctx,
182 > &manager.RecordWorkflowExecutionStartedRequest{
183 > VisibilityRequestBase: requestBase,
184 > },
185 > )
186 }
187
go.temporal.io/server/service/history/tasks/start_visibility_task.go 3 introduced LOC · 1 range

Open complete file

31 }
32
33 > func (t *StartExecutionVisibilityTask) GetTaskID() int64 { start_visibility_task.go
34 > return t.TaskID
35 > }
36
37 func (t *StartExecutionVisibilityTask) SetTaskID(id int64) {
go.temporal.io/server/service/history/queues/metrics.go 2 introduced LOC · 1 range

Open complete file

158 ) string {
159 switch task.(type) {
160 > case *tasks.StartExecutionVisibilityTask: metrics.go
161 > return metrics.TaskTypeVisibilityTaskStartExecution
162 case *tasks.UpsertExecutionVisibilityTask:
163 return metrics.TaskTypeVisibilityTaskUpsertExecution