workflow.go ×7

Frontier kind: Code frontier

unlabeled · c_be16590f2ad1

22 tests · 3200 LOC · 122 files · introduces 0 tests · 20 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges20 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
575 ranges3200 lines · 122 files · Browse complete extent
All tests (intent)
22 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: 20 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/scheduler/workflow.go 17 introduced LOC · 7 ranges

Open complete file

901
902 // now we know it's not running, remove from running workflow list
903 > matchRunning := func(ex *commonpb.WorkflowExecution) bool { return ex.GetWorkflowId() == id } workflow.go
904 > if idx := slices.IndexFunc(s.Info.RunningWorkflows, matchRunning); idx >= 0 {
905 > // We could also immediately update visibility, with updateMemoAndSearchAttributes,
906 > // but the wakeup here will trigger a write after anyways (after processing the buffer).
907 > s.Info.RunningWorkflows = slices.Delete(s.Info.RunningWorkflows, idx, idx+1)
908 > } else {
909 // This could happen if the watcher activity gets interrupted and is retried after the
910 // heartbeat timeout, but in the meantime we have done a refresh through a local activity.
914
915 // update workflow execution status in RecentActions
916 > if s.hasMinVersion(ActionResultIncludesStatus) { workflow.go
917 matchRecent := func(a *schedulepb.ScheduleActionResult) bool { return a.GetStartWorkflowResult().GetWorkflowId() == id }
918 if idx := slices.IndexFunc(s.Info.RecentActions, matchRecent); idx >= 0 {
922
923 // handle pause-on-failure
924 > failedStatus := res.Status == enumspb.WORKFLOW_EXECUTION_STATUS_FAILED || workflow.go
925 > res.Status == enumspb.WORKFLOW_EXECUTION_STATUS_TIMED_OUT ||
926 > (s.tweakables.CanceledTerminatedCountAsFailures &&
927 > (res.Status == enumspb.WORKFLOW_EXECUTION_STATUS_CANCELED || res.Status == enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED))
928 > pauseOnFailure := s.Schedule.Policies.PauseOnFailure && failedStatus && !s.Schedule.State.Paused
929 > if pauseOnFailure {
930 s.Schedule.State.Paused = true
931 if res.Status == enumspb.WORKFLOW_EXECUTION_STATUS_FAILED {
940
941 // handle last completion/failure and record resulting payload sizes
942 > if res.GetResult() != nil { workflow.go
943 s.State.LastCompletionResult = res.GetResult()
944 s.State.ContinuedFailure = nil
947 s.metrics.Counter(metrics.SchedulePayloadSize.Name()).Inc(int64(len(resultPayload)))
948 }
949 > } else if res.GetFailure() != nil { workflow.go
950 // leave LastCompletionResult from previous run
951 s.State.ContinuedFailure = res.GetFailure()
961 // (Attempt == -1) like CHASM, so BufferedStarts[0] is always the next
962 // pending start.
963 > if long && len(s.State.BufferedStarts) > 0 { workflow.go
964 s.State.BufferedStarts[0].DesiredTime = res.CloseTime
965 }
966
967 > s.logger.Debug("started workflow finished", "workflow", id, "status", res.Status, "pause-after-failure", pauseOnFailure, "long", long) workflow.go
968 }
969
go.temporal.io/server/api/schedule/v1/message.pb.go 3 introduced LOC · 1 range

Open complete file

695 }
696
697 > func (x *WatchWorkflowResponse) GetFailure() *v13.Failure { message.pb.go
698 > if x != nil {
699 > if x, ok := x.ResultFailure.(*WatchWorkflowResponse_Failure); ok {
700 return x.Failure
701 }