From 2b2d4b4795ee851c9efe97496e8b5cf316e78eb9 Mon Sep 17 00:00:00 2001 From: can Date: Thu, 18 Jun 2020 17:30:27 +0800 Subject: [PATCH] grpc: fix "too many ping" error in pd By setting "PermitWithoutStream" to false, configurations are consistent between server(pd) and client(br) side. Already fixed in tidb: https://github.com/pingcap/tidb/pull/17885 --- pkg/conn/conn.go | 5 ++--- pkg/restore/client.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/conn/conn.go b/pkg/conn/conn.go index c604cd7b5..01e7858dc 100644 --- a/pkg/conn/conn.go +++ b/pkg/conn/conn.go @@ -331,9 +331,8 @@ func (mgr *Mgr) getGrpcConnLocked(ctx context.Context, storeID uint64) (*grpc.Cl opt, grpc.WithConnectParams(grpc.ConnectParams{Backoff: bfConf}), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: time.Duration(keepAlive) * time.Second, - Timeout: time.Duration(keepAliveTimeout) * time.Second, - PermitWithoutStream: true, + Time: time.Duration(keepAlive) * time.Second, + Timeout: time.Duration(keepAliveTimeout) * time.Second, }), ) cancel() diff --git a/pkg/restore/client.go b/pkg/restore/client.go index 4e1f855c0..e4075a153 100644 --- a/pkg/restore/client.go +++ b/pkg/restore/client.go @@ -706,9 +706,8 @@ func (rc *Client) switchTiKVMode(ctx context.Context, mode import_sstpb.SwitchMo opt, grpc.WithConnectParams(grpc.ConnectParams{Backoff: bfConf}), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: time.Duration(keepAlive) * time.Second, - Timeout: time.Duration(keepAliveTimeout) * time.Second, - PermitWithoutStream: true, + Time: time.Duration(keepAlive) * time.Second, + Timeout: time.Duration(keepAliveTimeout) * time.Second, }), ) cancel()