Skip to content

Commit 05596fe

Browse files
authored
store: keep alive for etcd client (pingcap#14253)
Signed-off-by: qupeng <[email protected]>
1 parent 86ae838 commit 05596fe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

store/tikv/kv.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ type Driver struct {
5454
}
5555

5656
func createEtcdKV(addrs []string, tlsConfig *tls.Config) (*clientv3.Client, error) {
57+
cfg := config.GetGlobalConfig()
5758
cli, err := clientv3.New(clientv3.Config{
58-
Endpoints: addrs,
59-
AutoSyncInterval: 30 * time.Second,
60-
DialTimeout: 5 * time.Second,
61-
TLS: tlsConfig,
59+
Endpoints: addrs,
60+
AutoSyncInterval: 30 * time.Second,
61+
DialTimeout: 5 * time.Second,
62+
TLS: tlsConfig,
63+
DialKeepAliveTime: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTime),
64+
DialKeepAliveTimeout: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout),
65+
PermitWithoutStream: true,
6266
})
6367
if err != nil {
6468
return nil, errors.Trace(err)

0 commit comments

Comments
 (0)