Skip to content

Commit

Permalink
Tweak Update rate limit error
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanos committed Dec 10, 2024
1 parent f2d52ed commit e4e737d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion service/history/workflow/update/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ func (r *registry) checkTotalLimit() error {
if len(r.updates)+r.completedCount >= r.maxTotal() {
r.instrumentation.countTooMany()
return serviceerror.NewFailedPrecondition(
fmt.Sprintf("limit on number of total updates has been reached (%v)", r.maxTotal()),
fmt.Sprintf("The limit on the number of distinct updates in this workflow has been reached (%v). "+
"Make sure any duplicate updates share an Update ID so the server can deduplicate them, and consider rejecting updates that you aren't going to process", r.maxTotal()),
)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion tests/update_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5336,7 +5336,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() {
errs := err.(*serviceerror.MultiOperationExecution).OperationErrors()
s.Len(errs, 2)
s.Equal("Operation was aborted.", errs[0].Error())
s.Contains(errs[1].Error(), "limit on number of total updates has been reached")
s.Contains(errs[1].Error(), "limit on the number of distinct updates in this workflow has been reached")
})
}

Expand Down

0 comments on commit e4e737d

Please sign in to comment.