statemachine_environment.go ×8

Frontier kind: Code frontier

unlabeled · c_0f82139275d5

6 tests · 8814 LOC · 251 files · introduces 0 tests · 20 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges20 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1864 ranges8814 lines · 251 files · Browse complete extent
All tests (intent)
6 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: 20 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/statemachine_environment.go 20 introduced LOC · 8 ranges

Open complete file

189 validate func(workflowContext historyi.WorkflowContext, ms historyi.MutableState, potentialStaleState bool) error,
190 potentialStaleState bool,
191 > ) (historyi.MutableState, error) { statemachine_environment.go
192 > mutableState, err := wfCtx.LoadMutableState(ctx, e.shardContext)
193 > if err != nil {
194 return nil, err
195 }
196
197 > return mutableState, validate(wfCtx, mutableState, potentialStaleState) statemachine_environment.go
198 }
199
205 wfCtx historyi.WorkflowContext,
206 validate func(workflowContext historyi.WorkflowContext, ms historyi.MutableState, potentialStaleState bool) error,
207 > ) (historyi.MutableState, error) { statemachine_environment.go
208 > mutableState, err := e.loadAndValidateMutableStateNoReload(ctx, wfCtx, validate, true)
209 > if err == nil {
210 return mutableState, nil
211 }
331 key definition.WorkflowKey,
332 validate func(workflowContext historyi.WorkflowContext, ms historyi.MutableState, potentialStaleState bool) error,
333 > ) (historyi.WorkflowContext, historyi.ReleaseWorkflowContextFunc, historyi.MutableState, error) { statemachine_environment.go
334 > wfCtx, release, err := getWorkflowExecutionContext(ctx, e.shardContext, e.cache, key, chasm.WorkflowArchetypeID, locks.PriorityLow)
335 > if err != nil {
336 return nil, nil, nil, err
337 }
338
339 > ms, err := e.loadAndValidateMutableState(ctx, wfCtx, validate) statemachine_environment.go
340 >
341 > if err != nil {
342 // Release now with no error to prevent mutable state from being unloaded from the cache.
343 release(nil)
361 }
362
363 > func (e *stateMachineEnvironment) Access(ctx context.Context, ref hsm.Ref, accessType hsm.AccessType, accessor func(*hsm.Node) error) (retErr error) { statemachine_environment.go
364 > wfCtx, release, ms, err := e.getValidatedMutableState(
365 > ctx, ref.WorkflowKey, func(workflowContext historyi.WorkflowContext, ms historyi.MutableState, potentialStaleState bool) error {
366 > accessTypeForZombieValidation := accessType
367 > if ref.TaskID != 0 {
368 // For task references we never want to access a zombie workflow, even if the machine is accessed for read.
369 accessTypeForZombieValidation = hsm.AccessWrite
370 }
371 > if err := e.validateNotZombieWorkflow(ms, accessTypeForZombieValidation); err != nil { statemachine_environment.go
372 return err
373 }