separate context

If using the same context, the downstream grpc would be cancelled when the parent grpc is cancelled.
This commit is contained in:
chrislu 2024-03-27 10:24:57 -07:00
parent f67c8309d8
commit 17806cde2a

View File

@ -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)