context_impl.go ×9

Frontier kind: Code frontier

unlabeled · c_f0c0d7f7b122

145 tests · 4873 LOC · 180 files · introduces 0 tests · 59 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges59 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
862 ranges4873 lines · 180 files · Browse complete extent
All tests (intent)
145 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.

2 files ranked by introduced lines: 59 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/shard/context_impl.go 30 introduced LOC · 9 ranges

Open complete file

596 ctx context.Context,
597 request *persistence.UpdateWorkflowExecutionRequest,
598 > ) (*persistence.UpdateWorkflowExecutionResponse, error) { context_impl.go
599 > // do not try to get namespace cache within shard lock
600 > namespaceID := namespace.ID(request.UpdateWorkflowMutation.ExecutionInfo.NamespaceId)
601 > namespaceEntry, err := s.GetNamespaceRegistry().GetNamespaceByID(namespaceID)
602 > if err != nil {
603 return nil, err
604 }
605
606 > if err := s.ioSemaphoreAcquire(ctx); err != nil { context_impl.go
607 return nil, err
608 }
609 > defer s.ioSemaphoreRelease() context_impl.go
610 >
611 > s.wLock()
612 >
613 > // timeout check should be done within the shard lock, in case of shard lock contention
614 > ctx, cancel, err := s.newDetachedContext(ctx)
615 > if err != nil {
616 s.wUnlock()
617 return nil, err
618 }
619 > defer cancel() context_impl.go
620 >
621 > if err := s.errorByState(); err != nil {
622 s.wUnlock()
623 return nil, err
624 }
625
626 > if err := s.errorByNamespaceStateLocked(namespaceEntry.Name(), request.UpdateWorkflowMutation.ExecutionInfo.WorkflowId); err != nil { context_impl.go
627 s.wUnlock()
628 return nil, err
629 }
630
631 > taskMaps := make([]map[tasks.Category][]tasks.Task, 0, 2) context_impl.go
632 > taskMaps = append(taskMaps, request.UpdateWorkflowMutation.Tasks)
633 > if request.NewWorkflowSnapshot != nil {
634 taskMaps = append(taskMaps, request.NewWorkflowSnapshot.Tasks)
635 }
636 > requestCompletionFn, err := s.taskKeyManager.setAndTrackTaskKeys(taskMaps...) context_impl.go
637 > if err != nil {
638 s.wUnlock()
639 return nil, err
640 }
641 > s.updateCloseTaskIDs(request.UpdateWorkflowMutation.ExecutionInfo, request.UpdateWorkflowMutation.Tasks) context_impl.go
642 > if request.NewWorkflowSnapshot != nil {
643 s.updateCloseTaskIDs(request.NewWorkflowSnapshot.ExecutionInfo, request.NewWorkflowSnapshot.Tasks)
644 }
645
646 > request.RangeID = s.getRangeIDLocked() context_impl.go
647 > s.wUnlock()
648 >
649 > resp, err := s.executionManager.UpdateWorkflowExecution(ctx, request)
650 > requestCompletionFn(err)
651 > if err = s.handleWriteError(request.RangeID, err); err != nil {
652 return nil, err
653 }
go.temporal.io/server/service/history/workflow/context.go 29 introduced LOC · 5 ranges

Open complete file

819 }
820
821 > if err := c.mergeUpdateWithNewReplicationTasks( context.go
822 > updateWorkflow,
823 > newWorkflow,
824 > ); err != nil {
825 return err
826 }
827
828 > eventsToReapply := updateWorkflowEventsSeq context.go
829 > if len(updateWorkflowEventsSeq) == 0 {
830 if reapplyCandidateEvents := c.MutableState.GetReapplyCandidateEvents(); len(reapplyCandidateEvents) != 0 {
831 eventsToReapply = []*persistence.WorkflowEvents{
840 }
841
842 > if err := c.updateWorkflowExecutionEventReapply( context.go
843 > ctx,
844 > shardContext,
845 > updateMode,
846 > eventsToReapply,
847 > // The new run is created by applying events so the history builder in newMutableState contains the events be re-applied.
848 > // So we can use newWorkflowEventsSeq directly to reapply events.
849 > newWorkflowEventsSeq,
850 > ); err != nil {
851 return err
852 }
853
854 > if _, _, err := NewTransaction(shardContext).UpdateWorkflowExecution( context.go
855 > ctx,
856 > updateMode,
857 > c.archetypeID,
858 > c.MutableState.GetCurrentVersion(),
859 > updateWorkflow,
860 > updateWorkflowEventsSeq,
861 > MutableStateFailoverVersion(newMutableState),
862 > newWorkflow,
863 > newWorkflowEventsSeq,
864 > c.MutableState.IsWorkflow(),
865 > ); err != nil {
866 return err
867 }
1043 eventBatch1 []*persistence.WorkflowEvents,
1044 eventBatch2 []*persistence.WorkflowEvents,
1045 > ) error { context.go
1046 > if updateMode == persistence.UpdateWorkflowModeIgnoreCurrent {
1047 if len(eventBatch1) != 0 || len(eventBatch2) != 0 {
1048 return serviceerror.NewInternal("encountered events reapplication without knowing if workflow is current. Events generated for a close workflow?")