api.go ×7

Frontier kind: Code frontier

unlabeled · c_7663e6d96202

57 tests · 6718 LOC · 204 files · introduces 0 tests · 27 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges27 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1399 ranges6718 lines · 204 files · Browse complete extent
All tests (intent)
57 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: 27 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/api.go 27 introduced LOC · 7 ranges

Open complete file

484 }
485
486 > wtFailedShouldCreateNewTask := false api.go
487 > if wtFailedCause != nil {
488 effects.Cancel(ctx)
489
539 }
540
541 > newWorkflowTaskType := enumsspb.WORKFLOW_TASK_TYPE_UNSPECIFIED api.go
542 > // Do not schedule a new workflow task if the workflow is paused. Accepting the in-flight
543 > // WT completion is intentional (see HistoryBuilder buffering of WORKFLOW_EXECUTION_PAUSED),
544 > // but scheduling a follow-up WT would call ApplyWorkflowTaskScheduledEvent, which resets
545 > // Status to RUNNING while leaving executionInfo.PauseInfo set — desyncing pause state.
546 > // Mirrors the gate in closeTransactionHandleWorkflowTaskScheduling.
547 > if ms.IsWorkflowExecutionRunning() && !ms.IsWorkflowExecutionStatusPaused() {
548 if request.GetForceCreateNewWorkflowTask() || // Heartbeat WT is always of Normal type.
549 wtFailedShouldCreateNewTask ||
565 }
566
567 > bypassTaskGeneration := request.GetReturnNewWorkflowTask() && wtFailedCause == nil api.go
568 > // TODO (alex-update): All current SDKs always set ReturnNewWorkflowTask to true
569 > // which means that server always bypass task generation if WFT didn't fail.
570 > // ReturnNewWorkflowTask flag needs to be removed.
571 >
572 > if newWorkflowTaskType == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE && !bypassTaskGeneration {
573 // If task generation can't be bypassed (i.e. WFT has failed),
574 // WFT must be created as Normal because speculative WFT by nature skips task generation.
576 }
577
578 > var newWorkflowTask *historyi.WorkflowTaskInfo api.go
579 >
580 > // Speculative workflow task will be created after mutable state is persisted.
581 > if newWorkflowTaskType == enumsspb.WORKFLOW_TASK_TYPE_NORMAL {
582 versioningStamp := request.WorkerVersionStamp
583 if versioningStamp.GetUseVersioning() {
640 }
641
642 > var updateErr error api.go
643 > if newMutableState != nil {
644 newWorkflowExecutionInfo := newMutableState.GetExecutionInfo()
645 newWorkflowExecutionState := newMutableState.GetExecutionState()
661 newMutableState,
662 )
663 > } else { api.go
664 > // If completedEvent is not nil (which means that this WT wasn't speculative)
665 > // OR new WT is normal, then mutable state needs to be persisted.
666 > // Otherwise, (both current and new WT are speculative) mutable state is updated in memory only but not persisted.
667 > if completedEvent != nil || newWorkflowTaskType == enumsspb.WORKFLOW_TASK_TYPE_NORMAL {
668 updateErr = weContext.UpdateWorkflowExecutionAsActive(ctx, handler.shardContext)
669 }
670 }
671
672 > if updateErr != nil { api.go
673 effects.Cancel(ctx)
674 if persistence.IsConflictErr(updateErr) {