From 528300213228598571841a2251e64465cb1a298c Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Tue, 29 Jul 2014 16:13:44 -0700 Subject: [PATCH] server: set short dial timeout for raft communication --- etcd/etcd.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etcd/etcd.go b/etcd/etcd.go index d9b190ef4..834b1c514 100644 --- a/etcd/etcd.go +++ b/etcd/etcd.go @@ -20,6 +20,7 @@ import ( "crypto/tls" "fmt" "log" + "net" "net/http" "net/url" "os" @@ -74,6 +75,7 @@ func New(c *config.Config) (*Server, error) { tr := new(http.Transport) tr.TLSClientConfig = tc + tr.Dial = (&net.Dialer{Timeout: 200 * time.Millisecond}).Dial client := &http.Client{Transport: tr} s := &Server{