mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 18:10:57 +08:00
separate context
If using the same context, the downstream grpc would be cancelled when the parent grpc is cancelled.
This commit is contained in:
parent
f67c8309d8
commit
17806cde2a
@ -67,7 +67,7 @@ func (b *MessageQueueBroker) PublishMessage(stream mq_pb.SeaweedMessaging_Publis
|
|||||||
// connect to follower brokers
|
// connect to follower brokers
|
||||||
if localTopicPartition.FollowerStream == nil && len(initMessage.FollowerBrokers) > 0 {
|
if localTopicPartition.FollowerStream == nil && len(initMessage.FollowerBrokers) > 0 {
|
||||||
follower := initMessage.FollowerBrokers[0]
|
follower := initMessage.FollowerBrokers[0]
|
||||||
ctx := stream.Context()
|
ctx := context.Background()
|
||||||
localTopicPartition.FollowerGrpcConnection, err = pb.GrpcDial(ctx, follower, true, b.grpcDialOption)
|
localTopicPartition.FollowerGrpcConnection, err = pb.GrpcDial(ctx, follower, true, b.grpcDialOption)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.Error = fmt.Sprintf("fail to dial %s: %v", follower, err)
|
response.Error = fmt.Sprintf("fail to dial %s: %v", follower, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user