api.go ×7

Frontier kind: Code frontier

unlabeled · c_5b32a7810452

21 tests · 8109 LOC · 256 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1653 ranges8109 lines · 256 files · Browse complete extent
All tests (intent)
21 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: 41 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/startworkflow/api.go 41 introduced LOC · 7 ranges

Open complete file

359 }
360
361 > if err := s.verifyNamespaceActive(creationParams, currentWorkflowConditionFailed); err != nil { api.go
362 return nil, StartErr, err
363 }
364
365 > response, startOutcome, err := s.resolveDuplicateWorkflowID(ctx, currentWorkflowConditionFailed) api.go
366 > if err != nil {
367 return nil, StartErr, err
368 > } else if response != nil { api.go
369 return response, startOutcome, nil
370 }
409 creationParams *creationParams,
410 currentWorkflowConditionFailed *persistence.CurrentWorkflowConditionFailedError,
411 > ) error { api.go
412 > if creationParams.workflowLease.GetMutableState().GetCurrentVersion() < currentWorkflowConditionFailed.LastWriteVersion {
413 clusterMetadata := s.shardContext.GetClusterMetadata()
414 clusterName := clusterMetadata.ClusterNameForFailoverVersion(s.namespace.IsGlobalNamespace(), currentWorkflowConditionFailed.LastWriteVersion)
419 )
420 }
421 > return nil api.go
422 }
423
427 ctx context.Context,
428 currentWorkflowConditionFailed *persistence.CurrentWorkflowConditionFailedError,
429 > ) (*historyservice.StartWorkflowExecutionResponse, StartOutcome, error) { api.go
430 > workflowID := s.request.StartRequest.WorkflowId
431 >
432 > currentWorkflowStartTime := time.Time{}
433 > if s.shardContext.GetConfig().EnableWorkflowIdReuseStartTimeValidation(s.namespace.Name().String()) &&
434 > currentWorkflowConditionFailed.StartTime != nil {
435 currentWorkflowStartTime = *currentWorkflowConditionFailed.StartTime
436 }
437
438 > workflowKey := definition.NewWorkflowKey( api.go
439 > s.namespace.ID().String(),
440 > workflowID,
441 > currentWorkflowConditionFailed.RunID,
442 > )
443 >
444 > // Using a new RunID here to simplify locking: MultiOperation, that re-uses the Starter, is creating
445 > // a locked workflow context for each new workflow. Using a fresh RunID prevents a deadlock with the
446 > // previously created workflow context.
447 > newRunID := primitives.NewUUID().String()
448 >
449 > currentExecutionUpdateAction, err := api.ResolveDuplicateWorkflowID(
450 > s.shardContext,
451 > workflowKey,
452 > s.namespace,
453 > newRunID,
454 > currentWorkflowConditionFailed.State,
455 > currentWorkflowConditionFailed.Status,
456 > currentWorkflowConditionFailed.RequestIDs,
457 > currentWorkflowConditionFailed.FirstExecutionRunID,
458 > s.request.StartRequest.GetWorkflowIdReusePolicy(),
459 > s.request.StartRequest.GetWorkflowIdConflictPolicy(),
460 > currentWorkflowStartTime,
461 > s.request.ParentExecutionInfo,
462 > s.request.ChildWorkflowOnly,
463 > )
464 >
465 > switch {
466 case errors.Is(err, api.ErrUseCurrentExecution):
467 return s.handleUseExistingWorkflowOnConflictOptions(