timeskipping.go ×7

Frontier kind: Joint frontier

unlabeled · c_bbbb77d5bbf3

1 test · 8693 LOC · 257 files · introduces 1 test · 28 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges28 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1864 ranges8693 lines · 257 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.

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

go.temporal.io/server/service/history/workflow/timeskipping.go 22 introduced LOC · 7 ranges

Open complete file

469
470 func (ms *MutableStateImpl) AddWorkflowExecutionTimeSkippingTransitionedEvent(
471 > ctx context.Context, targetTime time.Time, disabledAfterFastForward bool) (*historypb.HistoryEvent, error) { timeskipping.go
472 > opTag := tag.WorkflowActionWorkflowExecutionTimeSkippingTransitioned
473 > if err := ms.checkMutability(opTag); err != nil {
474 return nil, err
475 }
476 > event := ms.hBuilder.AddWorkflowExecutionTimeSkippingTransitionedEvent( timeskipping.go
477 > targetTime, disabledAfterFastForward)
478 > return event, ms.ApplyWorkflowExecutionTimeSkippingTransitionedEvent(ctx, event)
479 }
480
481 > func (ms *MutableStateImpl) ApplyWorkflowExecutionTimeSkippingTransitionedEvent(ctx context.Context, event *historypb.HistoryEvent) error { timeskipping.go
482 >
483 > attr := event.GetWorkflowExecutionTimeSkippingTransitionedEventAttributes()
484 > tsi := ms.executionInfo.GetTimeSkippingInfo()
485 >
486 > opTag := tag.WorkflowActionWorkflowExecutionTimeSkippingTransitioned
487 > invalidTransitionError := serviceerror.NewInternal("TimeSkippingTransitionedEvent failed to apply")
488 > if tsi == nil {
489 ms.logError("TimeSkippingTransitionedEvent failed to apply: TimeSkippingInfo is nil", opTag)
490 return invalidTransitionError
491 }
492 > if attr.TargetTime == nil && !attr.GetDisabledAfterFastForward() { timeskipping.go
493 ms.logError("TimeSkippingTransitionedEvent failed to apply: TargetTime is nil and disabled after fast-forward is false", opTag)
494 return invalidTransitionError
496
497 // update time
498 > if !timeNotSet(attr.TargetTime) { timeskipping.go
499 asd := ms.accumulatedSkippedDuration() + attr.TargetTime.AsTime().Sub(event.GetEventTime().AsTime())
500 tsi.AccumulatedSkippedDuration = durationpb.New(asd)
501 }
502 // update enabled state
503 > tsi.Config.Enabled = !attr.GetDisabledAfterFastForward() timeskipping.go
504 > if attr.GetDisabledAfterFastForward() && tsi.GetFastForwardInfo() != nil {
505 > tsi.FastForwardInfo.HasReached = true
506 > }
507
508 > ms.timeSkippingInfoUpdated = true timeskipping.go
509 > return nil
510 }
511
go.temporal.io/server/service/history/timer_queue_active_task_executor.go 4 introduced LOC · 2 ranges

Open complete file

990 // 3) firing fast-forward timer (only turns off time skipping, and no task regeneration)
991 // TODO@time-skipping: chasm execution path is not implemented yet.
992 > _, err = mutableState.AddWorkflowExecutionTimeSkippingTransitionedEvent( timer_queue_active_task_executor.go
993 > ctx, time.Time{}, true)
994 > if err != nil {
995 return err
996 }
997 > return t.updateWorkflowExecution(ctx, weContext, mutableState, false) timer_queue_active_task_executor.go
998 }
999
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 2 introduced LOC · 1 range

Open complete file

7943
7944 if ms.timeSkippingInfoUpdated && ms.executionInfo.TimeSkippingInfo != nil {
7945 > ms.executionInfo.TimeSkippingInfo.LastUpdateVersionedTransition = currentVersionedTransition mutable_state_impl.go
7946 > }
7947
7948 // LastUpdateVersionTransition for HSM nodes already updated when transitioning the nodes.