get_workflow_util.go ×9

Frontier kind: Code frontier

unlabeled · c_093ba3f68f13

14 tests · 7223 LOC · 215 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1491 ranges7223 lines · 215 files · Browse complete extent
All tests (intent)
14 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: 31 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/get_workflow_util.go 28 introduced LOC · 9 ranges

Open complete file

128 // and the event ID we are looking for is smaller than current next event ID
129 if expectedNextEventID >= response.GetNextEventId() && response.GetWorkflowStatus() == enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING {
130 > subscriberID, channel, err := eventNotifier.WatchHistoryEvent(workflowKey) get_workflow_util.go
131 > if err != nil {
132 return nil, err
133 }
134 > defer func() { _ = eventNotifier.UnwatchHistoryEvent(workflowKey, subscriberID) }() get_workflow_util.go
135 // check again in case the next event ID is updated
136 > response, err = GetMutableStateWithConsistencyCheck( get_workflow_util.go
137 > ctx,
138 > shardContext,
139 > workflowKey,
140 > request.VersionHistoryItem.GetVersion(),
141 > request.VersionHistoryItem.GetEventId(),
142 > request.VersionedTransition,
143 > workflowConsistencyChecker,
144 > )
145 > if err != nil {
146 return nil, err
147 }
148 > currentVersionHistory, err = versionhistory.GetCurrentVersionHistory(response.GetVersionHistories()) get_workflow_util.go
149 > if err != nil {
150 return nil, err
151 }
152
153 > transitionHistory := response.GetTransitionHistory() get_workflow_util.go
154 > currentVersionedTransition := transitionhistory.LastVersionedTransition(transitionHistory)
155 > if len(transitionHistory) != 0 && request.VersionedTransition != nil {
156 if transitionhistory.StalenessCheck(transitionHistory, request.VersionedTransition) != nil {
157 logger.Warn(fmt.Sprintf("Request versioned transition and transition history don't match prior to polling the mutable state. Request: %v, current: %v",
164 }
165 }
166 > if !versionhistory.ContainsVersionHistoryItem(currentVersionHistory, request.VersionHistoryItem) { get_workflow_util.go
167 logItem, err := versionhistory.GetLastVersionHistoryItem(currentVersionHistory)
168 if err != nil {
178 return nil, serviceerrors.NewCurrentBranchChanged(response.CurrentBranchToken, request.CurrentBranchToken, currentVersionedTransition, request.VersionedTransition)
179 }
180 > if expectedNextEventID < response.GetNextEventId() || response.GetWorkflowStatus() != enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING { get_workflow_util.go
181 return response, nil
182 }
183
184 > namespaceRegistry, err := shardContext.GetNamespaceRegistry().GetNamespaceByID(namespaceID) get_workflow_util.go
185 > if err != nil {
186 return nil, err
187 }
188
189 // Send back response just before caller context would time out.
190 > longPollInterval := shardContext.GetConfig().LongPollExpirationInterval(namespaceRegistry.Name().String()) get_workflow_util.go
191 > longPollCtx, cancel := contextutil.WithDeadlineBuffer(ctx, longPollInterval, common.DefaultLongPollBuffer)
192 > defer cancel()
193 >
194 > for {
195 > select {
196 case event := <-channel:
197 response.LastFirstEventId = event.LastFirstEventID
go.temporal.io/server/service/history/shard/context_impl.go 3 introduced LOC · 1 range

Open complete file

1496 }
1497
1498 > func (s *ContextImpl) GetLifecycleContext() context.Context { context_impl.go
1499 > return s.lifecycleCtx
1500 > }
1501
1502 func (s *ContextImpl) stoppedForOwnershipLost() bool {