task_generator.go ×2

Frontier kind: Code frontier

unlabeled · c_53ab395efa77

74 tests · 2557 LOC · 130 files · introduces 0 tests · 27 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges27 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
378 ranges2557 lines · 130 files · Browse complete extent
All tests (intent)
74 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: 27 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/task_generator.go 27 introduced LOC · 2 ranges

Open complete file

224 // This will also save one call to visibility storage and one timer task creation.
225 if !deleteAfterClose {
226 > // In most cases, the value of "now" is the closeEvent time. task_generator.go
227 > // however this is not true for task refresh, where now is
228 > // the refresh time, not the close time.
229 > // Also can't always use close time as "now" when calling the method
230 > // as it will be used as visibilityTimestamp for immediate task and
231 > // for emitting task_latency_queue/load metric. If close time is used
232 > // as now, upon refresh the latency metric may see a huge value.
233 > // TODO: remove all "now" parameters from task generator interface,
234 > // visibility timestamp for scheduled task should be calculated from event
235 > // or execution info in mutable state. For immediate task, visibility timestamp
236 > // should always be when the task is generated so that task_latency_queue/load
237 > // truly measures only task processing/loading latency.
238 > closeTasks = append(closeTasks,
239 > &tasks.CloseExecutionVisibilityTask{
240 > // TaskID, VisibilityTimestamp is set by shard
241 > WorkflowKey: r.mutableState.GetWorkflowKey(),
242 > Version: closeVersion,
243 > },
244 > )
245 > if r.archivalEnabled() {
246 retention, err := r.getRetention()
247 if err != nil {
920 // archivalEnabled returns true if archival is enabled for either history or visibility.
921 // For both history and visibility, we check that archival is enabled for both the cluster and the namespace.
922 > func (r *TaskGeneratorImpl) archivalEnabled() bool { task_generator.go
923 > namespaceEntry := r.mutableState.GetNamespaceEntry()
924 > return r.archivalMetadata.GetHistoryConfig().ClusterConfiguredForArchival() &&
925 > namespaceEntry.HistoryArchivalState().State == enumspb.ARCHIVAL_STATE_ENABLED ||
926 > r.archivalMetadata.GetVisibilityConfig().ClusterConfiguredForArchival() &&
927 > namespaceEntry.VisibilityArchivalState().State == enumspb.ARCHIVAL_STATE_ENABLED
928 > }
929
930 func generateSubStateMachineTask(