executors.go ×6

Frontier kind: Code frontier

unlabeled · c_f61e5e2fe13f

4 tests · 3499 LOC · 146 files · introduces 0 tests · 35 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges35 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
662 ranges3499 lines · 146 files · Browse complete extent
All tests (intent)
4 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: 35 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/components/nexusoperations/executors.go 35 introduced LOC · 6 ranges

Open complete file

426 case callErr != nil:
427 err = e.handleStartOperationError(env, node, operation, callErr)
428 > case result.Pending != nil: executors.go
429 > err = e.saveStartedResult(env, node, operation, result)
430 default:
431 // Operation completed synchronously. Store the result and update the state machine.
456 // saveStartedResult transitions the operation to started in response to an async (pending) start
457 // response so it can later complete via callback.
458 > func (e taskExecutor) saveStartedResult(env hsm.Environment, node *hsm.Node, operation Operation, result *nexusrpc.ClientStartOperationResponse[*commonpb.Payload]) error { executors.go
459 > eventID, err := hsm.EventIDFromToken(operation.ScheduledEventToken)
460 > if err != nil {
461 return err
462 }
463 > links := commonnexus.ConvertNexusLinksToProtoLinks(result.Links, e.Logger) executors.go
464 > event := node.AddHistoryEvent(enumspb.EVENT_TYPE_NEXUS_OPERATION_STARTED, func(e *historypb.HistoryEvent) {
465 > // nolint:revive // We must mutate here even if the linter doesn't like it.
466 > e.Attributes = &historypb.HistoryEvent_NexusOperationStartedEventAttributes{
467 > NexusOperationStartedEventAttributes: &historypb.NexusOperationStartedEventAttributes{
468 > ScheduledEventId: eventID,
469 > OperationToken: result.Pending.Token,
470 > // TODO(bergundy): Remove this fallback after the 1.27 release.
471 > OperationId: result.Pending.Token,
472 > RequestId: operation.RequestId,
473 > },
474 > }
475 > // nolint:revive // We must mutate here even if the linter doesn't like it.
476 > e.Links = links
477 > })
478 > return hsm.MachineTransition(node, func(operation Operation) (hsm.TransitionOutput, error) {
479 > return TransitionStarted.Apply(operation, EventStarted{
480 > Time: env.Now(),
481 > Node: node,
482 > Attributes: event.GetNexusOperationStartedEventAttributes(),
483 > })
484 > })
485 }
486
513 emitOperationTimedOut(e.MetricsHandler, e.metricTagConfig(), op, namespaceName, workflowType, timeoutType.String(), closeTime)
514 }
515 > case enumsspb.NEXUS_OPERATION_STATE_STARTED: executors.go
516 > if op.StartedTime == nil {
517 return nil
518 }
519 > startedTime := op.StartedTime.AsTime() executors.go
520 > return func() {
521 > emitScheduleToStartLatency(e.MetricsHandler, e.metricTagConfig(), op, namespaceName, workflowType, startedTime)
522 > }
523 default:
524 // Scheduled / backing off: a retryable attempt failure, nothing terminal to record.
995 }
996 if result.Pending != nil {
997 > return "pending" executors.go
998 > }
999 return "successful"
1000 }