Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wf-Diagnostics] add timeout error to failures #6346

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions service/worker/diagnostics/invariant/failure/failure.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func errorTypeFromReason(reason string) ErrorType {
if strings.Contains(reason, "Panic") {
return PanicError
}
if strings.Contains(reason, "Timeout") {
return TimeoutError
}
return CustomError
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Test__Check(t *testing.T) {
},
{
InvariantType: WorkflowFailed.String(),
Reason: CustomError.String(),
Reason: TimeoutError.String(),
Metadata: metadataInBytes,
},
},
Expand Down Expand Up @@ -123,7 +123,7 @@ func failedWfHistory() *types.GetWorkflowExecutionHistoryResponse {
},
{
WorkflowExecutionFailedEventAttributes: &types.WorkflowExecutionFailedEventAttributes{
Reason: common.StringPtr("custom error"),
Reason: common.StringPtr("cadenceInternal:Timeout START_TO_CLOSE"),
Details: []byte("test-activity-failure"),
DecisionTaskCompletedEventID: 10,
},
Expand Down
1 change: 1 addition & 0 deletions service/worker/diagnostics/invariant/failure/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
CustomError ErrorType = "The failure is caused by a specific custom error returned from the service code"
GenericError ErrorType = "The failure is because of an error returned from the service code"
PanicError ErrorType = "The failure is caused by a panic in the service code"
TimeoutError ErrorType = "The failure is caused by a timeout during the execution"
)

func (e ErrorType) String() string {
Expand Down
Loading