Browse Source

separate context

If using the same context, the downstream grpc would be cancelled when the parent grpc is cancelled.
mq-subscribe
chrislu 9 months ago
parent
commit
17806cde2a
  1. 2
      weed/mq/broker/broker_grpc_pub.go

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

Loading…
Cancel
Save