activity.go ×2

Frontier kind: Code frontier

unlabeled · c_1e3cbd7ac286

10 tests · 4663 LOC · 192 files · introduces 0 tests · 36 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges36 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
718 ranges4663 lines · 192 files · Browse complete extent
All tests (intent)
10 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.

2 files ranked by introduced lines: 36 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/activity.go 19 introduced LOC · 2 ranges

Open complete file

64 nextScheduledTime *timestamppb.Timestamp,
65 isActivityRetryStampIncrementEnabled bool,
66 > ) { activity.go
67 > previousAttempt := ai.Attempt
68 > ai.Attempt = attempt
69 > ai.Version = version
70 > ai.ScheduledTime = nextScheduledTime
71 > ClearActivityStartedState(ai)
72 > // Mark per-attempt timers for recreation.
73 > ai.TimerTaskStatus &^= TimerTaskStatusCreatedHeartbeat | TimerTaskStatusCreatedStartToClose | TimerTaskStatusCreatedScheduleToStart
74 > ai.RetryLastWorkerIdentity = ai.StartedIdentity
75 > ai.RetryLastFailure = failure
76 > // this flag means the user resets the activity with "--reset-heartbeat" flag
77 > // server sends heartbeat details to the worker with the new activity attempt
78 > // if the current attempt was still running - worker can still send new heartbeats, and even complete the activity
79 > // so for the current activity attempt server continue to accept the heartbeats, but reset it for the new attempt
80 > if ai.ResetHeartbeats {
81 ai.LastHeartbeatDetails = nil
82 ai.LastHeartbeatUpdateTime = nil
83 }
84 > ai.ActivityReset = false activity.go
85 > ai.ResetHeartbeats = false
86 >
87 > if isActivityRetryStampIncrementEnabled && attempt > previousAttempt {
88 ai.Stamp++
89 }
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 17 introduced LOC · 2 ranges

Open complete file

6883 nextAttempt int32,
6884 activityFailure *failurepb.Failure,
6885 > ) error { mutable_state_impl.go
6886 > return ms.UpdateActivity(ai.ScheduledEventId, func(activityInfo *persistencespb.ActivityInfo, _ historyi.MutableState) error {
6887 > UpdateActivityInfoForRetries(
6888 > activityInfo,
6889 > ms.GetCurrentVersion(),
6890 > nextAttempt,
6891 > ms.truncateRetryableActivityFailure(activityFailure),
6892 > timestamppb.New(nextScheduledTime),
6893 > ms.config.EnableActivityRetryStampIncrement(),
6894 > )
6895 > return nil
6896 > })
6897 }
6898
7107 func (ms *MutableStateImpl) truncateRetryableActivityFailure(
7108 activityFailure *failurepb.Failure,
7109 > ) *failurepb.Failure { mutable_state_impl.go
7110 > namespaceName := ms.namespaceEntry.Name().String()
7111 > failureSize := activityFailure.Size()
7112 >
7113 > if failureSize <= ms.config.MutableStateActivityFailureSizeLimitWarn(namespaceName) {
7114 return activityFailure
7115 }