workflow_task_completed_handler.go ×4

Frontier kind: Code frontier

unlabeled · c_658b7134716b

5 tests · 3227 LOC · 144 files · introduces 0 tests · 65 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges65 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
434 ranges3227 lines · 144 files · Browse complete extent
All tests (intent)
5 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: 65 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/workflow_task_completed_handler.go 65 introduced LOC · 4 ranges

Open complete file

589 }
590
591 > var stamp *commonpb.WorkerVersionStamp workflow_task_completed_handler.go
592 > // eager activity always uses workflow's build ID
593 > buildId := handler.mutableState.GetAssignedBuildId()
594 > stamp = &commonpb.WorkerVersionStamp{UseVersioning: buildId != "", BuildId: buildId}
595 >
596 > shardClock, err := handler.shard.NewVectorClock()
597 > if err != nil {
598 return nil, err
599 }
600
601 > if _, err := handler.mutableState.AddActivityTaskStartedEvent( workflow_task_completed_handler.go
602 > ai,
603 > ai.GetScheduledEventId(),
604 > uuid.NewString(),
605 > handler.identity,
606 > stamp,
607 > nil,
608 > nil,
609 > handler.workerControlTaskQueue, // Eager: activity runs on the same worker that completed the WFT.
610 > shardClock,
611 > ); err != nil {
612 return nil, err
613 }
614
615 > executionInfo := handler.mutableState.GetExecutionInfo() workflow_task_completed_handler.go
616 > namespaceID := namespace.ID(executionInfo.NamespaceId)
617 > runID := handler.mutableState.GetExecutionState().RunId
618 >
619 > taskToken := tasktoken.NewActivityTaskToken(
620 > namespaceID.String(),
621 > executionInfo.WorkflowId,
622 > runID,
623 > ai.GetScheduledEventId(),
624 > attr.ActivityId,
625 > attr.ActivityType.GetName(),
626 > ai.Attempt,
627 > shardClock,
628 > ai.Version,
629 > ai.StartVersion,
630 > nil,
631 > 0,
632 > )
633 > serializedToken, err := handler.tokenSerializer.Serialize(taskToken)
634 > if err != nil {
635 return nil, err
636 }
637
638 > activityTask := &workflowservice.PollActivityTaskQueueResponse{ workflow_task_completed_handler.go
639 > ActivityId: attr.ActivityId,
640 > ActivityType: attr.ActivityType,
641 > Header: attr.Header,
642 > Input: attr.Input,
643 > WorkflowExecution: &commonpb.WorkflowExecution{
644 > WorkflowId: executionInfo.WorkflowId,
645 > RunId: runID,
646 > },
647 > CurrentAttemptScheduledTime: ai.ScheduledTime,
648 > ScheduledTime: ai.ScheduledTime,
649 > ScheduleToCloseTimeout: attr.ScheduleToCloseTimeout,
650 > StartedTime: ai.StartedTime,
651 > StartToCloseTimeout: attr.StartToCloseTimeout,
652 > HeartbeatTimeout: attr.HeartbeatTimeout,
653 > TaskToken: serializedToken,
654 > Attempt: ai.Attempt,
655 > HeartbeatDetails: ai.LastHeartbeatDetails,
656 > WorkflowType: handler.mutableState.GetWorkflowType(),
657 > WorkflowNamespace: handler.mutableState.GetNamespaceEntry().Name().String(),
658 > Priority: ai.Priority,
659 > }
660 > metrics.ActivityEagerExecutionCounter.With(
661 > workflow.GetPerTaskQueueFamilyScope(handler.metricsHandler, handler.mutableState.GetNamespaceEntry().Name(), ai.TaskQueue, handler.config),
662 > ).Record(1)
663 >
664 > return func(resp *historyservice.RespondWorkflowTaskCompletedResponse) error {
665 resp.ActivityTasks = append(resp.ActivityTasks, activityTask)
666 return nil