From f6f0fb12e0afaaa637698caca6a6316095bd3d09 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Mon, 20 Nov 2017 09:30:23 -0800 Subject: [PATCH] etcdserver/corrupt: set dial timeout for peer clientv3 Preliminary commit for initial hash checking. Dial timeout when other nodes have not been booted. Signed-off-by: Gyu-Ho Lee --- etcdserver/corrupt.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etcdserver/corrupt.go b/etcdserver/corrupt.go index ea6149543..b44af6318 100644 --- a/etcdserver/corrupt.go +++ b/etcdserver/corrupt.go @@ -56,8 +56,12 @@ func (s *EtcdServer) checkHashKV() error { continue } - cli, cerr := clientv3.New(clientv3.Config{Endpoints: m.PeerURLs}) + cli, cerr := clientv3.New(clientv3.Config{ + DialTimeout: s.Cfg.ReqTimeout(), + Endpoints: m.PeerURLs, + }) if cerr != nil { + plog.Warningf("%s failed to create client to peer %s for hash checking (%v)", s.ID(), types.ID(m.ID), cerr) continue }