timer_queue_active_task_executor.go ×9

Frontier kind: Joint frontier

unlabeled · c_e1743e2119ca

1 test · 8489 LOC · 257 files · introduces 1 test · 50 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges50 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1739 ranges8489 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.

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

go.temporal.io/server/service/history/timer_queue_active_task_executor.go 50 introduced LOC · 9 ranges

Open complete file

574 return consts.ErrActivityTaskNotFound
575 }
576 > err = CheckTaskVersion(t.shardContext, t.logger, mutableState.GetNamespaceEntry(), activityInfo.Version, task.Version, task) timer_queue_active_task_executor.go
577 > if err != nil {
578 return err
579 }
580
581 > if !mutableState.IsWorkflowExecutionRunning() { timer_queue_active_task_executor.go
582 release(nil) // release(nil) so mutable state is not unloaded from cache
583 return consts.ErrWorkflowCompleted
584 }
585
586 > err = t.processActivityWorkflowRules(ctx, weContext, mutableState, activityInfo) timer_queue_active_task_executor.go
587 > if err != nil {
588 return err
589 }
590
591 // task can be paused as the result of processing activity workflow rules, so we need to check again
592 > if task.Stamp != activityInfo.Stamp || activityInfo.Paused { timer_queue_active_task_executor.go
593 // if retry task event is from an old stamp of if activity is paused we should ignore the event.
594 release(nil) // release(nil) so mutable state is not unloaded from cache
596 }
597
598 > taskQueue := &taskqueuepb.TaskQueue{ timer_queue_active_task_executor.go
599 > Name: activityInfo.TaskQueue,
600 > Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
601 > }
602 > scheduleToStartTimeout := timestamp.DurationValue(activityInfo.ScheduleToStartTimeout)
603 > directive := MakeDirectiveForActivityTask(mutableState, activityInfo)
604 > useWfBuildId := activityInfo.GetUseWorkflowBuildIdInfo() != nil
605 > priority := priorities.Merge(mutableState.GetExecutionInfo().Priority, activityInfo.Priority)
606 >
607 > // NOTE: do not access anything related mutable state after this lock release
608 > release(nil) // release earlier as we don't need the lock anymore
609 >
610 > resp, err := t.matchingRawClient.AddActivityTask(ctx, &matchingservice.AddActivityTaskRequest{
611 > NamespaceId: task.GetNamespaceID(),
612 > Execution: &commonpb.WorkflowExecution{
613 > WorkflowId: task.GetWorkflowID(),
614 > RunId: task.GetRunID(),
615 > },
616 > TaskQueue: taskQueue,
617 > ScheduledEventId: task.EventID,
618 > ScheduleToStartTimeout: durationpb.New(scheduleToStartTimeout),
619 > Clock: vclock.NewVectorClock(t.shardContext.GetClusterMetadata().GetClusterID(), t.shardContext.GetShardID(), task.TaskID),
620 > VersionDirective: directive,
621 > Stamp: task.Stamp,
622 > Priority: priority,
623 > })
624 > if err != nil {
625 return err
626 }
627
628 > if useWfBuildId { timer_queue_active_task_executor.go
629 // activity's build ID is the same as WF's, so no need to update MS
630 return nil
631 }
632
633 > return updateIndependentActivityBuildId( timer_queue_active_task_executor.go
634 > ctx,
635 > task,
636 > resp.AssignedBuildId,
637 > t.shardContext,
638 > historyi.TransactionPolicyActive,
639 > t.cache,
640 > t.metricsHandler,
641 > t.logger,
642 > )
643 }
644
1049 ms historyi.MutableState,
1050 ai *persistencespb.ActivityInfo,
1052 > if ai.Paused {
1053 return nil
1054 }
1055
1056 > activityChanged := workflow.ActivityMatchWorkflowRules(ms, t.shardContext.GetTimeSource(), t.logger, ai) timer_queue_active_task_executor.go
1057 > if !activityChanged {
1058 > return nil
1059 > }
1060 if ai.Paused {
1061 // need to update activity