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

Do not use Unvailable as error type for expected error cases #4650

Merged
merged 2 commits into from
Jul 20, 2023
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
4 changes: 2 additions & 2 deletions service/history/consts/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ var (
// ErrSignalsLimitExceeded is the error indicating limit reached for maximum number of signal events
ErrSignalsLimitExceeded = serviceerror.NewInvalidArgument("exceeded workflow execution limit for signal events")
// ErrWorkflowClosing is the error indicating requests to workflow got rejected due to workflow is closing
ErrWorkflowClosing = serviceerror.NewUnavailable("workflow operation rejected because workflow is closing")
ErrWorkflowClosing = serviceerror.NewWorkflowNotReady("workflow operation rejected because workflow is closing")
// ErrEventsAterWorkflowFinish is the error indicating server error trying to write events after workflow finish event
ErrEventsAterWorkflowFinish = serviceerror.NewInternal("error validating last event being workflow finish event")
// ErrQueryEnteredInvalidState is error indicating query entered invalid state
ErrQueryEnteredInvalidState = serviceerror.NewInvalidArgument("query entered invalid state, this should be impossible")
// ErrConsistentQueryBufferExceeded is error indicating that too many consistent queries have been buffered and until buffered queries are finished new consistent queries cannot be buffered
ErrConsistentQueryBufferExceeded = serviceerror.NewUnavailable("consistent query buffer is full, cannot accept new consistent queries")
ErrConsistentQueryBufferExceeded = serviceerror.NewWorkflowNotReady("consistent query buffer is full, this may be caused by too many queries and workflow not able to process query fast enough")
// ErrEmptyHistoryRawEventBatch indicate that one single batch of history raw events is of size 0
ErrEmptyHistoryRawEventBatch = serviceerror.NewInvalidArgument("encountered empty history batch")
// ErrHistorySizeExceedsLimit is error indicating workflow execution has exceeded system defined history size limit
Expand Down
3 changes: 2 additions & 1 deletion tests/signal_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"go.temporal.io/api/serviceerror"
taskqueuepb "go.temporal.io/api/taskqueue/v1"
"go.temporal.io/api/workflowservice/v1"
"go.temporal.io/server/service/history/consts"

"go.temporal.io/server/common/convert"
"go.temporal.io/server/common/log/tag"
Expand Down Expand Up @@ -853,7 +854,7 @@ func (s *integrationSuite) TestSignalWorkflow_WorkflowCloseAttempted() {
RequestId: uuid.New(),
})
s.Error(err)
s.IsType(&serviceerror.Unavailable{}, err)
s.Error(consts.ErrWorkflowClosing, err)
}

attemptCount++
Expand Down