Skip to content

Commit

Permalink
Cluster not found (#4501)
Browse files Browse the repository at this point in the history
* Change cluster not found error to unavailable error
  • Loading branch information
yux0 authored Jun 16, 2023
1 parent 9330f52 commit bddbc74
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/clientBean.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ func (h *clientBeanImpl) GetRemoteAdminClient(cluster string) (adminservice.Admi

clusterInfo, clusterFound := h.clusterMetadata.GetAllClusterInfo()[cluster]
if !clusterFound {
return nil, &serviceerror.NotFound{
// We intentionally return internal error here.
// This error could only happen with internal mis-configuration.
// This can happen when a namespace is config for multiple clusters. But those clusters are not connected.
// We also have logic in task processing to drop tasks when namespace cluster exclude a local cluster.
return nil, &serviceerror.Internal{
Message: fmt.Sprintf(
"Unknown cluster name: %v with given cluster information map: %v.",
cluster,
Expand Down Expand Up @@ -229,7 +233,11 @@ func (h *clientBeanImpl) GetRemoteFrontendClient(clusterName string) (grpc.Clien

clusterInfo, clusterFound := h.clusterMetadata.GetAllClusterInfo()[clusterName]
if !clusterFound {
return nil, nil, &serviceerror.NotFound{
// We intentionally return internal error here.
// This error could only happen with internal mis-configuration.
// This can happen when a namespace is config for multiple clusters. But those clusters are not connected.
// We also have logic in task processing to drop tasks when namespace cluster exclude a local cluster.
return nil, nil, &serviceerror.Internal{
Message: fmt.Sprintf(
"Unknown clusterName name: %v with given clusterName information map: %v.",
clusterName,
Expand Down

0 comments on commit bddbc74

Please sign in to comment.