ndc_task_util.go ×6

Frontier kind: Joint frontier

unlabeled · c_bf2100b5fc29

1 test · 6982 LOC · 248 files · introduces 1 test · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges32 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1343 ranges6982 lines · 248 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.

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

go.temporal.io/server/service/history/ndc_task_util.go 30 introduced LOC · 6 ranges

Open complete file

172 // Depending on task type, there are exceptions when mutable state can't be stale.
173 // If this is a case, it is safe to use cached mutable state.
174 > if !canMutableStateBeStale(task, mutableState.GetExecutionInfo()) { ndc_task_util.go
175 return mutableState, nil
176 }
177 // Otherwise, clear workflow context, reload mutable state from a database and try again.
178
179 > metrics.StaleMutableStateCounter.With(metricsHandler).Record(1) ndc_task_util.go
180 > wfContext.Clear()
181 >
182 > mutableState, err = wfContext.LoadMutableState(ctx, shardContext)
183 > if err != nil {
184 return nil, err
185 }
186
187 > if err := validateTaskGeneration(ctx, shardContext, wfContext, mutableState, task.GetTaskID()); err != nil { ndc_task_util.go
188 return nil, err
189 }
190
191 > if eventID < mutableState.GetNextEventID() { ndc_task_util.go
192 return mutableState, nil
193 }
194 // After reloading mutable state from a database, task's event ID is still not valid,
195 // means that task is obsolete and can be safely skipped.
196 > getNamespaceTagByID(shardContext.GetNamespaceRegistry(), task.GetNamespaceID()) ndc_task_util.go
197 > metrics.TaskSkipped.With(metricsHandler).Record(
198 > 1,
199 > getNamespaceTagByID(shardContext.GetNamespaceRegistry(), task.GetNamespaceID()),
200 > metrics.TaskTypeTag(taskTypeTag),
201 > metrics.ArchetypeTag(chasm.WorkflowComponentName),
202 > )
203 > logger.Info("Task processor skipping task: task event ID >= MS NextEventID.",
204 > tag.WorkflowNextEventID(mutableState.GetNextEventID()),
205 > )
206 > return nil, nil
207 }
208
281 timerTask tasks.Task,
282 executionInfo *persistencespb.WorkflowExecutionInfo,
283 > ) bool { ndc_task_util.go
284 >
285 > // Check to see if mutable state cache needs to be reloaded from a database.
286 > // Exceptions are:
287 > // 1. Transient workflow task that doesn't generate events (check only that it is still current WFT).
288 > // 2. Speculative workflow task that doesn't generate events.
289 >
290 > wttt, isWttt := timerTask.(*tasks.WorkflowTaskTimeoutTask)
291 > if !isWttt {
292 > return true
293 > }
294
295 isSpeculativeWorkflowTask := wttt.GetCategory() == tasks.CategoryMemoryTimer
go.temporal.io/server/service/history/timer_queue_standby_task_executor.go 2 introduced LOC · 1 range

Open complete file

758 }
759 if mutableState == nil {
761 > }
762
763 historyResendInfo, err := actionFn(ctx, executionContext, mutableState, release)