From 17806cde2af54a0aa08642f6e5f381e703b84788 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 27 Mar 2024 10:24:57 -0700 Subject: [PATCH] separate context If using the same context, the downstream grpc would be cancelled when the parent grpc is cancelled. --- weed/mq/broker/broker_grpc_pub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/mq/broker/broker_grpc_pub.go b/weed/mq/broker/broker_grpc_pub.go index 3937399bd..ab4320a9d 100644 --- a/weed/mq/broker/broker_grpc_pub.go +++ b/weed/mq/broker/broker_grpc_pub.go @@ -67,7 +67,7 @@ func (b *MessageQueueBroker) PublishMessage(stream mq_pb.SeaweedMessaging_Publis // connect to follower brokers if localTopicPartition.FollowerStream == nil && len(initMessage.FollowerBrokers) > 0 { follower := initMessage.FollowerBrokers[0] - ctx := stream.Context() + ctx := context.Background() localTopicPartition.FollowerGrpcConnection, err = pb.GrpcDial(ctx, follower, true, b.grpcDialOption) if err != nil { response.Error = fmt.Sprintf("fail to dial %s: %v", follower, err)