user_data_manager.go ×10

Frontier kind: Joint frontier

unlabeled · c_da12bd69e522

1 test · 3667 LOC · 153 files · introduces 1 test · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges34 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
666 ranges3667 lines · 153 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

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

go.temporal.io/server/service/matching/user_data_manager.go 34 introduced LOC · 10 ranges

Open complete file

668 wfPartitions int,
669 actPartitions int,
670 > ) error { user_data_manager.go
671 > if m.store == nil {
672 return serviceerror.NewInvalidArgument("CheckTaskQueueUserDataPropagation must be called on root workflow task queue")
673 > } else if version < 1 { user_data_manager.go
674 return serviceerror.NewInvalidArgument("CheckTaskQueueUserDataPropagation must wait for version >= 1")
675 }
676
677 > complete := make(chan error) user_data_manager.go
678 >
679 > var waitingForPartitions atomic.Int64
680 > waitingForPartitions.Store(int64(wfPartitions - 1 + actPartitions))
681 >
682 > policy := backoff.NewExponentialRetryPolicy(500 * time.Millisecond)
683 > isRetryable := func(err error) bool {
684 if strings.Contains(err.Error(), errRequestedVersionTooLarge.Error()) {
685 // It is possible that multiple updates are happening at once and this partition has not
690 }
691
692 > check := func(p int, tp enumspb.TaskQueueType) { user_data_manager.go
693 > err := backoff.ThrottleRetryContext(ctx, func(ctx context.Context) error {
694 > res, err := m.matchingClient.GetTaskQueueUserData(ctx, &matchingservice.GetTaskQueueUserDataRequest{
695 > NamespaceId: m.partition.NamespaceId(),
696 > TaskQueue: m.partition.TaskQueue().NormalPartition(p).RpcName(),
697 > TaskQueueType: tp,
698 > LastKnownUserDataVersion: version - 1,
699 > WaitNewData: true,
700 > OnlyIfLoaded: true,
701 > })
702 > if err != nil {
703 var failed *serviceerror.FailedPrecondition
704 if errors.As(err, &failed) {
707 }
708 return err
709 > } else if res.GetUserData().GetVersion() < version { user_data_manager.go
710 return serviceerror.NewUnavailable("retry")
711 }
712 > return nil user_data_manager.go
713 }, policy, isRetryable)
714 > if err == nil { user_data_manager.go
715 > if waitingForPartitions.Add(-1) == 0 {
716 > complete <- nil
717 > }
718 }
719 }
720
721 > for i := 1; i < wfPartitions; i++ { user_data_manager.go
722 > go check(i, enumspb.TASK_QUEUE_TYPE_WORKFLOW)
723 > }
724 > for i := range actPartitions {
725 go check(i, enumspb.TASK_QUEUE_TYPE_ACTIVITY)
726 }
727
728 > select { user_data_manager.go
729 case <-ctx.Done():
730 return ctx.Err()
731 > case err := <-complete: user_data_manager.go
732 > return err
733 }
734 }