api.go ×8

Frontier kind: Code frontier

unlabeled · c_f312d7641469

18 tests · 6333 LOC · 209 files · introduces 0 tests · 57 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges57 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1201 ranges6333 lines · 209 files · Browse complete extent
All tests (intent)
18 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: 57 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/recordworkflowtaskstarted/api.go 49 introduced LOC · 8 ranges

Open complete file

119 // The stickiness info is used by frontend to decide if it should send down partial history or full history.
120 // Sending down partial history will cost the worker an extra fetch to server for the full history.
121 > currentTaskQueue := mutableState.CurrentTaskQueue() api.go
122 > pollerTaskQueue := req.PollRequest.TaskQueue
123 > if currentTaskQueue.Kind == enumspb.TASK_QUEUE_KIND_STICKY &&
124 > currentTaskQueue.GetName() != pollerTaskQueue.GetName() {
125 // For versioned workflows we additionally check for the poller queue to not be a sticky queue itself.
126 // Although it's ideal to check this for unversioned workflows as well, we can't rely on older clients
136 }
137
138 > if currentTaskQueue.Kind == enumspb.TASK_QUEUE_KIND_NORMAL && api.go
139 > pollerTaskQueue.Kind == enumspb.TASK_QUEUE_KIND_STICKY {
140 // A poll from a sticky queue while the workflow's task queue is not yet sticky
141 // should be rejected. This means the task was a stale task on the matching queue.
149 }
150
151 > wfBehavior := mutableState.GetEffectiveVersioningBehavior() api.go
152 > wfDeployment := mutableState.GetEffectiveDeployment()
153 > //nolint:staticcheck // SA1019 deprecated WorkerVersionCapabilities will clean up later
154 > pollerDeployment, err := worker_versioning.DeploymentFromCapabilities(req.PollRequest.WorkerVersionCapabilities, req.PollRequest.DeploymentOptions)
155 > if err != nil {
156 return nil, err
157 }
158 > err = worker_versioning.ValidateTaskVersionDirective(req.GetVersionDirective(), wfBehavior, wfDeployment, req.ScheduledDeployment) api.go
159 > if err != nil {
160 return nil, err
161 }
162
163 > _, workflowTask, err = mutableState.AddWorkflowTaskStartedEvent( api.go
164 > scheduledEventID,
165 > requestID,
166 > pollerTaskQueue,
167 > req.PollRequest.Identity,
168 > worker_versioning.StampFromCapabilities(req.PollRequest.WorkerVersionCapabilities, req.PollRequest.DeploymentOptions), //nolint:staticcheck // SA1019: WorkerVersionCapabilities is deprecated but still used for old versioning [cleanup-old-wv]
169 > req.GetBuildIdRedirectInfo(),
170 > workflowLease.GetContext().UpdateRegistry(ctx),
171 > false,
172 > req.TargetDeploymentVersion,
173 > req.TaskDispatchRevisionNumber,
174 > )
175 > if err != nil {
176 // Unable to add WorkflowTaskStarted event to history
177 return nil, err
178 }
179
180 > if workflowTask.Type == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE { api.go
181 updateAction.Noop = true
182 > } else { api.go
183 // If the wft is speculative MS changes are not persisted, so the possibly started
184 // transition by the StartDeploymentTransition call above won't be persisted. This is OK
206 }
207
208 > workflowScheduleToStartLatency := workflowTask.StartedTime.Sub(workflowTask.ScheduledTime) api.go
209 > namespaceName := namespaceEntry.Name()
210 > tqPartition := tqid.UnsafePartitionFromProto(workflowTask.TaskQueue, req.GetNamespaceId(), enumspb.TASK_QUEUE_TYPE_WORKFLOW)
211 > metrics.TaskScheduleToStartLatency.With(
212 > metrics.GetPerTaskQueuePartitionTypeScope(
213 > metricsScope,
214 > namespaceName.String(),
215 > tqPartition,
216 > config.BreakdownMetricsByTaskQueue(namespaceName.String(), tqPartition.TaskQueue().Name(), enumspb.TASK_QUEUE_TYPE_WORKFLOW),
217 > ),
218 > ).Record(workflowScheduleToStartLatency)
219 >
220 > resp, err = CreateRecordWorkflowTaskStartedResponseWithRawHistory(
221 > ctx,
222 > mutableState,
223 > updateRegistry,
224 > workflowTask,
225 > req.PollRequest.GetIdentity(),
226 > false,
227 > )
228 > if err != nil {
229 return nil, err
230 }
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 8 introduced LOC · 2 ranges

Open complete file

1275 }
1276
1277 > func (x *RecordWorkflowTaskStartedRequest) GetBuildIdRedirectInfo() *v113.BuildIdRedirectInfo { request_response.pb.go
1278 > if x != nil {
1279 > return x.BuildIdRedirectInfo
1280 > }
1281 return nil
1282 }
1289 }
1290
1291 > func (x *RecordWorkflowTaskStartedRequest) GetVersionDirective() *v113.TaskVersionDirective { request_response.pb.go
1292 > if x != nil {
1293 > return x.VersionDirective
1294 > }
1295 return nil
1296 }