From 10a6f6e748c3e379d23fcdf6f12862e705d52d87 Mon Sep 17 00:00:00 2001 From: Yimin Chen Date: Fri, 4 Aug 2023 14:00:58 -0700 Subject: [PATCH] Return ResourceExhaustedError for consistent query buffer full (#4731) **What changed?** Return ResourceExhaustedError instead of WorkflowNotReady (which is FailedPrecondition). **Why?** So this can be retried by client. **How did you test it?** Existing unit tests **Potential risks** No **Is hotfix candidate?** --- service/history/consts/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/history/consts/const.go b/service/history/consts/const.go index 4c185db947a..7fd4ea177aa 100644 --- a/service/history/consts/const.go +++ b/service/history/consts/const.go @@ -76,7 +76,7 @@ var ( // 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.NewWorkflowNotReady("consistent query buffer is full, this may be caused by too many queries and workflow not able to process query fast enough") + ErrConsistentQueryBufferExceeded = serviceerror.NewResourceExhausted(enumspb.RESOURCE_EXHAUSTED_CAUSE_BUSY_WORKFLOW, "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