executable.go ×8

Frontier kind: Code frontier

unlabeled · c_9ec3d9471c65

70 tests · 2711 LOC · 137 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
426 ranges2711 lines · 137 files · Browse complete extent
All tests (intent)
70 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.

1 file ranked by introduced lines: 34 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/queues/executable.go 34 introduced LOC · 8 ranges

Open complete file

263 }
264
265 > ns, _ := e.namespaceRegistry.GetNamespaceName(namespace.ID(e.GetNamespaceID())) executable.go
266 > var callerInfo headers.CallerInfo
267 > switch e.priority {
268 > case ctasks.PriorityHigh:
269 > callerInfo = headers.NewBackgroundHighCallerInfo(ns.String())
270 case ctasks.PriorityLow:
271 callerInfo = headers.NewBackgroundLowCallerInfo(ns.String())
274 callerInfo = headers.NewPreemptableCallerInfo(ns.String())
275 }
276 > ctx := headers.SetCallerInfo( executable.go
277 > metrics.AddMetricsContext(context.Background()),
278 > callerInfo,
279 > )
280 > e.Unlock()
281 >
282 > // Wrapped in if block to avoid unnecessary allocations when OTEL is disabled.
283 > if telemetry.IsEnabled(e.tracer) {
284 var span trace.Span
285
323 }
324
325 > defer func() { executable.go
326 > if pObj := recover(); pObj != nil {
327 err, ok := pObj.(error)
328 if !ok {
338 }
339
340 > attemptUserLatency := time.Duration(0) executable.go
341 > if duration, ok := metrics.ContextCounterGet(ctx, metrics.HistoryWorkflowExecutionCacheLatency.Name()); ok {
342 attemptUserLatency = time.Duration(duration)
343 }
344
345 > attemptLatency := e.timeSource.Now().Sub(startTime) executable.go
346 > e.attemptNoUserLatency = attemptLatency - attemptUserLatency
347 > // emit total attempt latency so that we know how much time a task will occpy a worker goroutine
348 > metrics.TaskProcessingLatency.With(e.chasmMetricsHandler).Record(attemptLatency)
349 >
350 > if persistenceDuration, ok := metrics.ContextCounterGet(ctx, metrics.TaskPersistenceLatency.Name()); ok {
351 attemptNoPersistence := attemptLatency - time.Duration(persistenceDuration)
352 metrics.TaskProcessingNoPersistenceLatency.With(e.chasmMetricsHandler).Record(attemptNoPersistence)
353 }
354
355 > priorityTaggedProvider := e.chasmMetricsHandler.WithTags(metrics.TaskPriorityTag(e.priority.String())) executable.go
356 > metrics.TaskRequests.With(priorityTaggedProvider).Record(1)
357 > metrics.TaskScheduleLatency.With(priorityTaggedProvider).Record(e.scheduleLatency)
358 > metrics.OperationCounter.With(e.defaultMetricsHandler).Record(1)
359 >
360 > if retErr == nil {
361 e.inMemoryNoUserLatency += e.scheduleLatency + e.attemptNoUserLatency
362 }
367 // A previous attempt has marked this executable as no longer retryable.
368 // Instead of executing it, we try to write to the DLQ if enabled, otherwise - drop it.
369 > if e.terminalFailureCause != nil { executable.go
370 if e.dlqEnabled() {
371 return e.writeToDLQ(ctx)
382 }
383
384 > resp := e.executor.Execute(ctx, e) executable.go
385 > e.refreshMetricsHandlers(resp.ExecutionMetricTags)
386 >
387 > if resp.ExecutedAsActive != e.lastActiveness {
388 // namespace did a failover,
389 // reset task attempt since the execution logic used will change