From dc02825ea7c906621a7ddfeab6ef0a3804172afb Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Thu, 2 Mar 2023 14:03:08 +0800 Subject: [PATCH] fix member race problem Signed-off-by: Ryan Leung --- server/grpc_service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/grpc_service.go b/server/grpc_service.go index cb3edd4192c0..2cf13f92fc53 100644 --- a/server/grpc_service.go +++ b/server/grpc_service.go @@ -102,7 +102,12 @@ func (s *GrpcServer) GetMembers(context.Context, *pdpb.GetMembersRequest) (*pdpb members, err := s.Server.GetMembers() if err != nil { return &pdpb.GetMembersResponse{ - Header: s.wrapErrorToHeader(pdpb.ErrorType_UNKNOWN, err.Error()), + Header: &pdpb.ResponseHeader{ + Error: &pdpb.Error{ + Type: pdpb.ErrorType_UNKNOWN, + Message: err.Error(), + }, + }, }, nil }