mutable_state_impl.go ×6

Frontier kind: Code frontier

unlabeled · c_7f3123adfc73

373 tests · 3779 LOC · 162 files · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
579 ranges3779 lines · 162 files · Browse complete extent
All tests (intent)
373 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: 19 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 19 introduced LOC · 6 ranges

Open complete file

1916 }
1917
1918 > func (ms *MutableStateImpl) Now() time.Time { mutable_state_impl.go
1919 > return ms.timeSource.Now()
1920 > }
1921
1922 // GetWorkflowCloseTime returns workflow closed time, returns a zero time for open workflow
7254 func (ms *MutableStateImpl) AddTasks(
7255 newTasks ...tasks.Task,
7257 > now := ms.Now()
7258 > for _, task := range newTasks {
7259 > if chasmTask, ok := task.(*tasks.ChasmTask); ok &&
7260 > chasmTask.GetCategory() == tasks.CategoryVisibility &&
7261 > ms.stateInDB == enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED {
7262 softassert.Fail(ms.logger, "CHASM visibility task added on already-closed execution")
7263 }
7264
7265 > category := task.GetCategory() mutable_state_impl.go
7266 > // Drop tasks scheduled too far in the future. VisibilityTime hasn't been
7267 > // shifted to wall-clock yet (the conversion runs below), so both sides are
7268 > // virtual here; the difference is frame-invariant (skip cancels). Keep
7269 > // `now` from ms.Now() so both stay in the same frame.
7270 > if category.Type() == tasks.CategoryTypeScheduled &&
7271 > task.GetVisibilityTime().Sub(now) > maxScheduledTaskDuration {
7272 ms.logger.Info("Dropped long duration scheduled task.", tasks.Tags(task)...)
7273 continue
7279 // vs. real distinction. The CategoryTypeScheduled drop-check above runs first so it
7280 // compares virtual-vs-virtual (now is also virtual).
7281 > if category.Type() == tasks.CategoryTypeScheduled { mutable_state_impl.go
7282 task.SetVisibilityTime(ms.ToRealTime(task.GetVisibilityTime()))
7283 }
7284
7285 > if chasmPureTask, ok := task.(*tasks.ChasmTaskPure); ok { mutable_state_impl.go
7286 ms.chasmPureTasks = append(ms.chasmPureTasks, chasmPureTask)
7287 maxPureTasks := ms.config.ChasmMaxInMemoryPureTasks()
7296 }
7297
7298 > ms.InsertTasks[category] = append(ms.InsertTasks[category], task) mutable_state_impl.go
7299 }
7300 }