-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
How issue was found:
Try adding same search attribute multiple times via cli - cli always gives "ok" response, for example try running this command multiple times:
temporal operator search-attribute create --name MyCustomSA --type Keyword
Search attributes have been added
When adding SA server has this loop where it creates aliasToFieldMap -
temporal/service/frontend/operator_handler.go
Line 279 in 4c24037
| for saName, saType := range request.GetSearchAttributes() { |
In this loop server logs the warn message with errSearchAttributeAlreadyExistsMessage
but because it does not add anything to map it just returns nil -
temporal/service/frontend/operator_handler.go
Line 334 in 4c24037
| return nil |
instead of serviceerror
this then in turn return nil to cli as response. cli does check for already exists error, but since server returns nil, error is never shown to user.
Ask is to change this code on server to return serviceError instead that tells cli/sdk/clients that they are trying to create a SA that already exists