tree.go ×11

Frontier kind: Code frontier

unlabeled · c_4b1640579b0a

4 tests · 2429 LOC · 95 files · introduces 0 tests · 40 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges40 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
430 ranges2429 lines · 95 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: 40 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/tree.go 40 introduced LOC · 11 ranges

Open complete file

3582 ctx context.Context,
3583 chasmTask *tasks.ChasmTask,
3584 > ) (isTaskInTree bool, isValidByComponent bool, retErr error) { tree.go
3585 >
3586 > taskInfo := chasmTask.Info
3587 > taskTypeID := taskInfo.TypeId
3588 > registrableTask, ok := n.registry.TaskByID(taskTypeID)
3589 > if !ok {
3590 return false, false, softassert.UnexpectedInternalErr(
3591 n.logger,
3594 }
3595
3596 > if registrableTask.isPureTask { tree.go
3597 return false, false, softassert.UnexpectedInternalErr(
3598 n.logger,
3601 }
3602
3603 > node, ok := n.findNode(taskInfo.Path) tree.go
3604 > if !ok {
3605 return false, false, nil
3606 }
3607
3608 // node.serializedNode should always be available when running a side effect task.
3609 > if transitionhistory.Compare( tree.go
3610 > taskInfo.ComponentInitialVersionedTransition,
3611 > node.serializedNode.Metadata.InitialVersionedTransition,
3612 > ) != 0 {
3613 return false, false, nil
3614 }
3623 // TaskVersionedTransition is unset on physical tasks created before this field
3624 // was added; skip the check in that case to preserve backward compatibility.
3625 > var logicalTask *persistencespb.ChasmComponentAttributes_Task tree.go
3626 > if taskInfo.TaskVersionedTransition != nil {
3627 componentAttr := node.serializedNode.Metadata.GetComponentAttributes()
3628 for _, t := range componentAttr.GetSideEffectTasks() {
3641
3642 // Component must be hydrated before the task's validator is called.
3643 > validateCtx := NewContext(newContextWithOperationIntent(ctx, OperationIntentProgress), n) tree.go
3644 > if err := node.prepareComponentValue(validateCtx); err != nil {
3645 return false, false, err
3646 }
3647
3648 > defer func() { tree.go
3649 > if rec := recover(); rec != nil {
3650 chasmTask.DeserializedTask = reflect.Value{}
3651 panic(rec) //nolint:forbidigo
3652 }
3653 > if retErr != nil { tree.go
3654 chasmTask.DeserializedTask = reflect.Value{}
3655 }
3656 }()
3657
3658 > if !chasmTask.DeserializedTask.IsValid() { tree.go
3659 > var err error
3660 > if logicalTask != nil {
3661 // Use the logical task's Data pointer so deserialization shares the
3662 // node's taskValueCache with closeTransactionCleanupInvalidTasks.
3664 // allocated from the physical task row) and would always miss the cache.
3665 chasmTask.DeserializedTask, err = node.deserializeTaskWithCache(registrableTask, logicalTask.Data)
3666 > } else { tree.go
3667 > // Backward compatibility: physical task predates TaskVersionedTransition.
3668 > chasmTask.DeserializedTask, err = deserializeTask(registrableTask, taskInfo.Data)
3669 > }
3670 > if err != nil {
3671 return false, false, err
3672 }
3673 }
3674
3675 > isValidByComponent, retErr = node.validateTask( tree.go
3676 > validateCtx,
3677 > TaskInvocation{
3678 > TaskAttributes: TaskAttributes{
3679 > ScheduledTime: chasmTask.GetVisibilityTime(),
3680 > Destination: chasmTask.Destination,
3681 > },
3682 > Attempt: chasmTask.Attempt,
3683 > },
3684 > chasmTask.DeserializedTask.Interface(),
3685 > )
3686 > return true, isValidByComponent, retErr
3687 }
3688