get_workflow_util.go ×6

Frontier kind: Code frontier

unlabeled · c_f3f712a227ea

12 tests · 7315 LOC · 215 files · introduces 0 tests · 26 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges26 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1512 ranges7315 lines · 215 files · Browse complete extent
All tests (intent)
12 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: 26 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/get_workflow_util.go 26 introduced LOC · 6 ranges

Open complete file

194 for {
195 select {
196 > case event := <-channel: get_workflow_util.go
197 > response.LastFirstEventId = event.LastFirstEventID
198 > response.LastFirstEventTxnId = event.LastFirstEventTxnID
199 > response.NextEventId = event.NextEventID
200 > response.PreviousStartedEventId = event.PreviousStartedEventID
201 > response.WorkflowState = event.WorkflowState
202 > response.WorkflowStatus = event.WorkflowStatus
203 > // Note: Later events could modify response.WorkerVersionStamp and we won't
204 > // update it here. That's okay since this return value is only informative and isn't used for task dispatch.
205 > // For correctness we could pass it in the Notification event.
206 > eventVersionHistory, err := versionhistory.GetCurrentVersionHistory(event.VersionHistories)
207 > if err != nil {
208 return nil, err
209 }
210 > response.CurrentBranchToken = eventVersionHistory.GetBranchToken() get_workflow_util.go
211 > response.VersionHistories = event.VersionHistories
212 > response.TransitionHistory = event.TransitionHistory
213 >
214 > notifiedEventVersionItem, err := versionhistory.GetLastVersionHistoryItem(eventVersionHistory)
215 > if err != nil {
216 return nil, err
217 }
218 // It is possible the notifier sends an out of date event, we can ignore this event.
219 > if versionhistory.CompareVersionHistoryItem(notifiedEventVersionItem, request.VersionHistoryItem) < 0 { get_workflow_util.go
220 continue
221 }
222 > transitionHistory := response.GetTransitionHistory() get_workflow_util.go
223 > currentVersionedTransition := transitionhistory.LastVersionedTransition(transitionHistory)
224 > if len(transitionHistory) != 0 && request.VersionedTransition != nil {
225 if transitionhistory.StalenessCheck(transitionHistory, request.VersionedTransition) != nil {
226 logger.Warn(fmt.Sprintf("Request versioned transition and transition history don't match after polling the mutable state. Request: %v, current: %v",
233 }
234 }
235 > if !versionhistory.ContainsVersionHistoryItem(eventVersionHistory, request.VersionHistoryItem) { get_workflow_util.go
236 logger.Warn("Request history branch and current history branch don't match after polling the mutable state",
237 tag.Value(notifiedEventVersionItem),
243 return nil, serviceerrors.NewCurrentBranchChanged(response.CurrentBranchToken, request.CurrentBranchToken, currentVersionedTransition, request.VersionedTransition)
244 }
245 > if expectedNextEventID < response.GetNextEventId() || response.GetWorkflowStatus() != enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING { get_workflow_util.go
246 > return response, nil
247 > }
248 case <-longPollCtx.Done():
249 return response, nil