chasm_engine.go ×10

Frontier kind: Code frontier

unlabeled · c_0c2def6bcb51

9 tests · 7227 LOC · 238 files · introduces 0 tests · 49 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges49 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1506 ranges7227 lines · 238 files · Browse complete extent
All tests (intent)
9 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: 49 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/chasm_engine.go 49 introduced LOC · 10 ranges

Open complete file

178 startFn func(chasm.MutableContext) (chasm.RootComponent, error),
179 opts ...chasm.TransitionOption,
180 > ) (chasm.StartExecutionResult, error) { chasm_engine.go
181 > options := e.constructTransitionOptions(opts...)
182 > result, err := e.startExecution(ctx, executionRef, startFn, options)
183 > return result, e.convertError(err, executionRef, options.RequestID)
184 > }
185
186 func (e *ChasmEngine) startExecution(
189 startFn func(chasm.MutableContext) (chasm.RootComponent, error),
190 options chasm.TransitionOptions,
191 > ) (result chasm.StartExecutionResult, retErr error) { chasm_engine.go
192 > shardContext, err := e.getShardContext(executionRef)
193 > if err != nil {
194 return chasm.StartExecutionResult{}, err
195 }
196
197 > archetypeID, err := executionRef.ArchetypeID(e.registry) chasm_engine.go
198 > if err != nil {
199 return chasm.StartExecutionResult{}, err
200 }
201
202 > if executionRef.RunID != "" { chasm_engine.go
203 return chasm.StartExecutionResult{}, serviceerror.NewUnimplemented("setting runID is not supported for StartExecution")
204 }
205
206 > currentExecutionReleaseFn, err := e.lockCurrentExecution( chasm_engine.go
207 > ctx,
208 > shardContext,
209 > namespace.ID(executionRef.NamespaceID),
210 > executionRef.BusinessID,
211 > archetypeID,
212 > )
213 > if err != nil {
214 return chasm.StartExecutionResult{}, err
215 }
216 > defer func() { chasm_engine.go
217 > currentExecutionReleaseFn(retErr)
218 > }()
219
220 > newExecutionParams, err := e.createNewExecution( chasm_engine.go
221 > ctx,
222 > shardContext,
223 > executionRef,
224 > archetypeID,
225 > startFn,
226 > options,
227 > )
228 > if err != nil {
229 return chasm.StartExecutionResult{}, err
230 }
231
232 > currentRunInfo, hasCurrentRun, err := e.persistAsBrandNew( chasm_engine.go
233 > ctx,
234 > shardContext,
235 > newExecutionParams,
236 > )
237 > if err != nil {
238 // Even though Created is false, it's not guaranteed the execution wasn't created.
239 // The persistence layer writes history events outside the main transaction, so on errors
241 return chasm.StartExecutionResult{}, err
242 }
243 > if !hasCurrentRun { chasm_engine.go
244 e.setContextMetadataFromMutableState(ctx, newExecutionParams.mutableState)
245 serializedRef, err := newExecutionParams.executionRef.Serialize(e.registry)
818 startFn func(chasm.MutableContext) (chasm.RootComponent, error),
819 options chasm.TransitionOptions,
820 > ) (newExecutionParams, error) { chasm_engine.go
821 > return e.createNewExecutionWithUpdate(
822 > ctx,
823 > shardContext,
824 > executionRef,
825 > archetypeID,
826 > startFn,
827 > nil,
828 > options,
829 > )
830 > }
831
832 func (e *ChasmEngine) createNewExecutionWithUpdate(