tree.go ×10

Frontier kind: Code frontier

unlabeled · c_fc6cec1f6e99

5 tests · 2854 LOC · 104 files · introduces 0 tests · 55 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges55 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
565 ranges2854 lines · 104 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: 55 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/tree.go 55 introduced LOC · 10 ranges

Open complete file

3727 callerName string,
3728 chasmTask *tasks.ChasmTask,
3729 > ) (*RegistrableTask, error) { tree.go
3730 > if engineFromContext(ctx) == nil {
3731 return nil, serviceerror.NewInternal("no CHASM engine set on context")
3732 }
3733
3734 > taskTypeID := chasmTask.Info.TypeId tree.go
3735 > registrableTask, ok := n.registry.TaskByID(taskTypeID)
3736 > if !ok {
3737 return nil, softassert.UnexpectedInternalErr(
3738 n.logger,
3740 fmt.Errorf("%d", taskTypeID))
3741 }
3742 > if registrableTask.isPureTask { tree.go
3743 return nil, softassert.UnexpectedInternalErr(
3744 n.logger,
3746 fmt.Errorf("%s", registrableTask.fqType()))
3747 }
3748 > return registrableTask, nil tree.go
3749 }
3750
3756 validate func(NodeBackend, Context, Component) error,
3757 taskFn func(context.Context, ComponentRef, TaskAttributes, any) error,
3758 > ) (retErr error) { tree.go
3759 > taskInfo := chasmTask.Info
3760 >
3761 > defer func() {
3762 > if rec := recover(); rec != nil {
3763 chasmTask.DeserializedTask = reflect.Value{}
3764 panic(rec) //nolint:forbidigo
3765 }
3766 > if retErr != nil && !errors.As(retErr, new(*serviceerror.NotFound)) { tree.go
3767 chasmTask.DeserializedTask = reflect.Value{}
3768 }
3769 }()
3770
3771 > if !chasmTask.DeserializedTask.IsValid() { tree.go
3772 > var err error
3773 > // TODO: Change physical side effect task to reference logical task and
3774 > // then use deserializeTaskWithCache as well.
3775 > chasmTask.DeserializedTask, err = deserializeTask(registrableTask, taskInfo.Data)
3776 > if err != nil {
3777 return err
3778 }
3779 }
3780 > taskValue := chasmTask.DeserializedTask tree.go
3781 >
3782 > taskAttributes := TaskAttributes{
3783 > ScheduledTime: chasmTask.GetVisibilityTime(),
3784 > Destination: chasmTask.Destination,
3785 > }
3786 >
3787 > ref := ComponentRef{
3788 > ExecutionKey: executionKey,
3789 > archetypeID: ArchetypeID(taskInfo.GetArchetypeId()),
3790 > executionLastUpdateVT: taskInfo.ComponentLastUpdateVersionedTransition,
3791 > componentPath: taskInfo.Path,
3792 > componentInitialVT: taskInfo.ComponentInitialVersionedTransition,
3793 >
3794 > // Validate the Ref only once it is accessed by the task's handler.
3795 > validationFn: makeValidationFn(registrableTask, validate, chasmTask.Attempt, taskAttributes, taskValue),
3796 > }
3797 >
3798 > ctx = newContextWithOperationIntent(ctx, OperationIntentProgress)
3799 >
3800 > defer log.CapturePanic(n.logger, &retErr)
3801 >
3802 > return taskFn(ctx, ref, taskAttributes, taskValue.Interface())
3803 }
3804
3837 taskAttributes TaskAttributes,
3838 taskValue reflect.Value,
3839 > ) func(NodeBackend, Context, Component, *Registry) error { tree.go
3840 > return func(backend NodeBackend, ctx Context, component Component, registry *Registry) error {
3841 > // Call the provided validation callback.
3842 > err := validate(backend, ctx, component)
3843 > if err != nil {
3844 return err
3845 }
3849
3850 // Call the TaskValidator.
3851 > valid, err := registrableTask.validateFn( tree.go
3852 > ctx,
3853 > component,
3854 > TaskInvocation{TaskAttributes: taskAttributes, Attempt: attempt},
3855 > taskValue.Interface(),
3856 > registry,
3857 > )
3858 > if err != nil {
3859 return err
3860 }