workflow.go ×5

Frontier kind: Code frontier

unlabeled · c_95c0c90d4631

41 tests · 2742 LOC · 120 files · introduces 0 tests · 14 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges14 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
455 ranges2742 lines · 120 files · Browse complete extent
All tests (intent)
41 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: 14 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/scheduler/workflow.go 14 introduced LOC · 5 ranges

Open complete file

603 // existing schedule workflows.
604 val := workflow.SideEffect(s.ctx, func(ctx workflow.Context) any {
605 > cache := &schedulespb.NextTimeCache{ workflow.go
606 > Version: int64(s.tweakables.Version),
607 > StartTime: timestamppb.New(start),
608 > NextTimes: make([]int64, 0, s.tweakables.NextTimeCacheV2Size),
609 > NominalTimes: make([]int64, 0, s.tweakables.NextTimeCacheV2Size),
610 > }
611 > for t := start; len(cache.NextTimes) < s.tweakables.NextTimeCacheV2Size; {
612 > next, err := s.cspec.GetNextTime(s.jitterSeed(), t)
613 > if errors.Is(err, ErrComputeLimitExceeded) {
614 s.metrics.Counter(metrics.ScheduleComputeLimitExceeded.Name()).Inc(1)
615 s.logger.Warn("schedule spec next-time search hit the compute limit; taking no further action until the spec is changed")
617 break
618 }
619 > if next.ComputeLimitWarning { workflow.go
620 // Warn (non-fatal) case: the search went long but still resolved. Surface it for
621 // observability and keep scheduling. This is the default protection mode.
623 s.logger.Warn("schedule spec next-time search crossed the warn threshold; continuing (spec may be over-excluded)")
624 }
625 > if next.Next.IsZero() { workflow.go
626 cache.Completed = true
627 break
635 t = next.Next
636 }
637 > return cache workflow.go
638 })
639 // Previous versions of this workflow returned a json-encoded value here. This will attempt
1579 func (s *scheduler) jitterSeed() string {
1580 if s.hasMinVersion(NewCacheAndJitter) {
1581 > return fmt.Sprintf("%s-%s", s.State.NamespaceId, s.State.ScheduleId) workflow.go
1582 > }
1583 return ""
1584 }