workflow_task_completed_handler.go ×9

Frontier kind: Joint frontier

unlabeled · c_c9c919dbf247

1 test · 10109 LOC · 270 files · introduces 1 test · 34 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges34 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2210 ranges10109 lines · 270 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 34 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/workflow_task_completed_handler.go 28 introduced LOC · 9 ranges

Open complete file

851 }
852
853 > if err := handler.validateCommandAttr( workflow_task_completed_handler.go
854 > func() (enumspb.WorkflowTaskFailedCause, error) {
855 > return handler.attrValidator.ValidateFailWorkflowExecutionAttributes(attr)
856 > },
857 ); err != nil || handler.stopProcessing {
858 return nil, err
859 }
860
861 > if err := handler.sizeLimitChecker.checkIfPayloadSizeExceedsLimit( workflow_task_completed_handler.go
862 > metrics.CommandTypeTag(enumspb.COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION.String()),
863 > attr.GetFailure().Size(),
864 > "FailWorkflowExecutionCommandAttributes.Failure exceeds size limit.",
865 > ); err != nil {
866 return nil, handler.terminateWorkflow(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES, err)
867 }
868
869 // If the workflow task has more than one completion event then just pick the first one
870 > if !handler.mutableState.IsWorkflowExecutionRunning() { workflow_task_completed_handler.go
871 metrics.MultipleCompletionCommandsCounter.With(handler.metricsHandler).Record(1)
872 handler.logger.Warn(
879
880 // First check retry policy to do a retry.
881 > retryBackoff, retryState := handler.mutableState.GetRetryBackoffDuration(attr.GetFailure()) workflow_task_completed_handler.go
882 > cronBackoff := backoff.NoBackoff
883 > if retryBackoff == backoff.NoBackoff {
884 > // If no retry, check cron.
885 > cronBackoff = handler.mutableState.GetCronBackoffDuration()
886 > }
887
888 > var newExecutionRunID string workflow_task_completed_handler.go
889 > if retryBackoff != backoff.NoBackoff || cronBackoff != backoff.NoBackoff {
890 newExecutionRunID = uuid.NewString()
891 }
892
893 // Always add workflow failed event
894 > event, err := handler.mutableState.AddFailWorkflowEvent( workflow_task_completed_handler.go
895 > handler.workflowTaskCompletedID,
896 > retryState,
897 > attr,
898 > newExecutionRunID,
899 > )
900 > if err != nil {
901 return nil, err
902 }
903
904 // Handle retry or cron
905 > if retryBackoff != backoff.NoBackoff { workflow_task_completed_handler.go
906 return event, handler.handleRetry(ctx, retryBackoff, attr.GetFailure(), newExecutionRunID)
907 > } else if cronBackoff != backoff.NoBackoff { workflow_task_completed_handler.go
908 return event, handler.handleCron(ctx, cronBackoff, nil, attr.GetFailure(), newExecutionRunID)
909 }
910
911 // No retry or cron
912 > return event, nil workflow_task_completed_handler.go
913 }
914
go.temporal.io/server/service/history/api/command_attr_validator.go 6 introduced LOC · 3 ranges

Open complete file

230 func (v *CommandAttrValidator) ValidateFailWorkflowExecutionAttributes(
231 attributes *commandpb.FailWorkflowExecutionCommandAttributes,
232 > ) (enumspb.WorkflowTaskFailedCause, error) { command_attr_validator.go
233 >
234 > const failedCause = enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES
235 > if attributes == nil {
236 return failedCause, serviceerror.NewInvalidArgument("FailWorkflowExecutionCommandAttributes is not set on FailWorkflowExecutionCommand.")
237 }
238 > if attributes.GetFailure() == nil { command_attr_validator.go
239 return failedCause, serviceerror.NewInvalidArgument("Failure is not set on FailWorkflowExecutionCommand.")
240 }
241 > return enumspb.WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED, nil command_attr_validator.go
242 }
243