Преглед изворни кода

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 <gyuhox@gmail.com>
Gyu-Ho Lee пре 8 година
родитељ
комит
f6f0fb12e0
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      etcdserver/corrupt.go

+ 5 - 1
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
 		}