workflow_task_state_machine.go ×6

Frontier kind: Code frontier

unlabeled · c_0d7ccab1d2cd

15 tests · 5731 LOC · 206 files · introduces 0 tests · 47 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges47 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1016 ranges5731 lines · 206 files · Browse complete extent
All tests (intent)
15 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: 47 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/workflow_task_state_machine.go 33 introduced LOC · 6 ranges

Open complete file

254 }
255
256 > func (m *workflowTaskStateMachine) ApplyWorkflowTaskFailedEvent() error { workflow_task_state_machine.go
257 > return m.failWorkflowTask(true)
258 > }
259
260 func (m *workflowTaskStateMachine) ApplyWorkflowTaskTimedOutEvent(timeoutType enumspb.TimeoutType) error {
897 newRunID string,
898 forkEventVersion int64,
899 > ) (*historypb.HistoryEvent, error) { workflow_task_state_machine.go
900 >
901 > // IMPORTANT: returned event can be nil under some circumstances. Specifically, if WT is transient.
902 >
903 > if workflowTask.Type == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE {
904 m.ms.RemoveSpeculativeWorkflowTaskTimeoutTask()
905
928 }
929
930 > var event *historypb.HistoryEvent workflow_task_state_machine.go
931 > // Only emit WorkflowTaskFailedEvent if workflow task is not transient.
932 > if !m.ms.IsTransientWorkflowTask() {
933 > event = m.ms.hBuilder.AddWorkflowTaskFailedEvent(
934 > workflowTask.ScheduledEventID,
935 > workflowTask.StartedEventID,
936 > cause,
937 > failure,
938 > identity,
939 > baseRunID,
940 > newRunID,
941 > forkEventVersion,
942 > binaryChecksum,
943 > )
944 >
945 > if event != nil {
946 > m.ms.executionInfo.LastWorkflowTaskFailure = &persistencespb.WorkflowExecutionInfo_LastWorkflowTaskFailureCause{
947 > LastWorkflowTaskFailureCause: cause,
948 > }
949 > }
950 }
951
952 > if err := m.ApplyWorkflowTaskFailedEvent(); err != nil { workflow_task_state_machine.go
953 return nil, err
954 }
955
956 > switch cause { workflow_task_state_machine.go
957 case enumspb.WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW,
958 enumspb.WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND:
965
966 // Attempt counter was incremented directly in mutable state. Current WT attempt counter needs to be updated.
967 > workflowTask.Attempt = m.ms.GetExecutionInfo().GetWorkflowTaskAttempt() workflow_task_state_machine.go
968 >
969 > return event, nil
970 }
971
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 14 introduced LOC · 2 ranges

Open complete file

4163 binChecksum, baseRunID, newRunID string,
4164 forkEventVersion int64,
4165 > ) (*historypb.HistoryEvent, error) { mutable_state_impl.go
4166 > opTag := tag.WorkflowActionWorkflowTaskFailed
4167 > if err := ms.checkMutability(opTag); err != nil {
4168 return nil, err
4169 }
4170 > return ms.workflowTaskManager.AddWorkflowTaskFailedEvent( mutable_state_impl.go
4171 > workflowTask,
4172 > cause,
4173 > failure,
4174 > identity,
4175 > versioningStamp,
4176 > binChecksum,
4177 > baseRunID,
4178 > newRunID,
4179 > forkEventVersion,
4180 > )
4181 }
4182