diff --git a/store/tikv/kv.go b/store/tikv/kv.go index d54365df00ba9..641c4c874a346 100644 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -54,11 +54,15 @@ type Driver struct { } func createEtcdKV(addrs []string, tlsConfig *tls.Config) (*clientv3.Client, error) { + cfg := config.GetGlobalConfig() cli, err := clientv3.New(clientv3.Config{ - Endpoints: addrs, - AutoSyncInterval: 30 * time.Second, - DialTimeout: 5 * time.Second, - TLS: tlsConfig, + Endpoints: addrs, + AutoSyncInterval: 30 * time.Second, + DialTimeout: 5 * time.Second, + TLS: tlsConfig, + DialKeepAliveTime: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTime), + DialKeepAliveTimeout: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout), + PermitWithoutStream: true, }) if err != nil { return nil, errors.Trace(err)