workflow_task_state_machine.go ×4

Frontier kind: Code frontier

unlabeled · c_cde69b8dad01

18 tests · 5648 LOC · 206 files · introduces 0 tests · 40 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges40 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1005 ranges5648 lines · 206 files · Browse complete extent
All tests (intent)
18 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: 40 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/workflow_task_state_machine.go 40 introduced LOC · 4 ranges

Open complete file

1041 func (m *workflowTaskStateMachine) failWorkflowTask(
1042 incrementAttempt bool,
1044 > // Get current workflow task info before clearing it, to capture timeout tasks for deletion
1045 > currentWorkflowTask := m.getWorkflowTaskInfo()
1046 > m.recordTimeoutTasksForDeletion(currentWorkflowTask)
1047 >
1048 > // Increment attempts only if workflow task is failing on non-sticky task queue.
1049 > // If it was sticky task queue, clear sticky task queue first and try again before creating transient workflow task.
1050 > if m.ms.IsStickyTaskQueueSet() {
1051 incrementAttempt = false
1052 m.ms.ClearStickyTaskQueue()
1053 }
1054
1055 > newAttemptsSinceLastSuccess := m.ms.executionInfo.WorkflowTaskAttemptsSinceLastSuccess workflow_task_state_machine.go
1056 > newAttempt := int32(1)
1057 > if incrementAttempt {
1058 > // Increment the failure counter for this WFT failure
1059 > newAttemptsSinceLastSuccess = m.ms.executionInfo.WorkflowTaskAttemptsSinceLastSuccess + 1
1060 > // Also increment Attempt for transient workflow task tracking
1061 > newAttempt = m.ms.executionInfo.WorkflowTaskAttempt + 1
1062 > if m.ms.config.EnableWorkflowTaskStampIncrementOnFailure() {
1063 m.ms.executionInfo.WorkflowTaskStamp += 1
1064 }
1065 }
1066
1067 > failWorkflowTaskInfo := &historyi.WorkflowTaskInfo{ workflow_task_state_machine.go
1068 > Version: common.EmptyVersion,
1069 > ScheduledEventID: common.EmptyEventID,
1070 > StartedEventID: common.EmptyEventID,
1071 > RequestID: emptyUUID,
1072 > WorkflowTaskTimeout: time.Duration(0),
1073 > StartedTime: time.Unix(0, 0).UTC(),
1074 > TaskQueue: nil,
1075 > Attempt: newAttempt,
1076 > AttemptsSinceLastSuccess: newAttemptsSinceLastSuccess,
1077 > OriginalScheduledTime: time.Unix(0, 0).UTC(),
1078 > Type: enumsspb.WORKFLOW_TASK_TYPE_UNSPECIFIED,
1079 > SuggestContinueAsNew: false,
1080 > SuggestContinueAsNewReasons: nil,
1081 > HistorySizeBytes: 0,
1082 > // need to retain Build ID of failed WF task to compare it with the build ID of next attempt
1083 > BuildId: m.ms.executionInfo.WorkflowTaskBuildId,
1084 > }
1085 > m.retainWorkflowTaskBuildIdInfo(failWorkflowTaskInfo)
1086 > m.UpdateWorkflowTask(failWorkflowTaskInfo)
1087 >
1088 > consecutiveFailuresRequired := m.ms.config.NumConsecutiveWorkflowTaskProblemsToTriggerSearchAttribute(m.ms.GetNamespaceEntry().Name().String())
1089 > if consecutiveFailuresRequired > 0 && failWorkflowTaskInfo.AttemptsSinceLastSuccess >= int32(consecutiveFailuresRequired) {
1090 if err := m.ms.UpdateReportedProblemsSearchAttribute(); err != nil {
1091 return err
1092 }
1093 }
1094 > return nil workflow_task_state_machine.go
1095 }
1096