From faffb2973c523253247a2ada4fd27408fcfee142 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 16 May 2024 11:02:48 -0700 Subject: [PATCH] adjust errors --- weed/mq/broker/broker_connect.go | 4 ++-- weed/mq/broker/broker_grpc_pub_balancer.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/weed/mq/broker/broker_connect.go b/weed/mq/broker/broker_connect.go index 3d58d89ea..386d86570 100644 --- a/weed/mq/broker/broker_connect.go +++ b/weed/mq/broker/broker_connect.go @@ -55,9 +55,9 @@ func (b *MessageQueueBroker) BrokerConnectToBalancer(brokerBalancer string, stop }) if err != nil { if err == io.EOF { - return err + // return err } - return fmt.Errorf("send stats message: %v", err) + return fmt.Errorf("send stats message to balancer %s: %v", brokerBalancer, err) } // glog.V(3).Infof("sent stats: %+v", stats) diff --git a/weed/mq/broker/broker_grpc_pub_balancer.go b/weed/mq/broker/broker_grpc_pub_balancer.go index 2cf90b4bc..b8675caca 100644 --- a/weed/mq/broker/broker_grpc_pub_balancer.go +++ b/weed/mq/broker/broker_grpc_pub_balancer.go @@ -1,6 +1,7 @@ package broker import ( + "fmt" "github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer" "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb" "google.golang.org/grpc/codes" @@ -14,7 +15,7 @@ func (b *MessageQueueBroker) PublisherToPubBalancer(stream mq_pb.SeaweedMessagin } req, err := stream.Recv() if err != nil { - return err + return fmt.Errorf("receive init message: %v", err) } // process init message @@ -33,7 +34,7 @@ func (b *MessageQueueBroker) PublisherToPubBalancer(stream mq_pb.SeaweedMessagin for { req, err := stream.Recv() if err != nil { - return err + return fmt.Errorf("receive stats message from %s: %v", initMessage.Broker, err) } if !b.isLockOwner() { return status.Errorf(codes.Unavailable, "not current broker balancer")