Skip to content

Commit dccaec9

Browse files
dreamingdeerdreamingdeerpashagolub
authored
[*] decrease etcd_leader_checker.Config.DialKeepAliveTime to 5sec (#195)
* fix(checker) fix 15 minute timeout -> 10 sec if etcd master die. Add some verbose for get process from etcd (etcd-io/etcd#8905) --------- Co-authored-by: dreamingdeer <[email protected]> Co-authored-by: Pavlo Golub <[email protected]>
1 parent 0c7e608 commit dccaec9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

checker/etcd_leader_checker.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ func NewEtcdLeaderChecker(con *vipconfig.Config) (*EtcdLeaderChecker, error) {
7474
cfg := client.Config{
7575
Endpoints: eConf.Endpoints,
7676
TLS: tlsConfig,
77-
DialKeepAliveTimeout: time.Second,
77+
DialKeepAliveTimeout: 5 * time.Second,
78+
DialKeepAliveTime: 5 * time.Second,
7879
Username: eConf.EtcdUser,
7980
Password: eConf.EtcdPassword,
8081
}
@@ -104,12 +105,15 @@ checkLoop:
104105
continue
105106
}
106107

107-
if (!alreadyConnected) {
108+
if !alreadyConnected {
108109
log.Printf("etcd checker started up, found key %s", e.key)
109110
alreadyConnected = true
110111
}
111112

112113
for _, kv := range resp.Kvs {
114+
if eConf.Verbose {
115+
log.Println("Leader from DCS:", string(kv.Value))
116+
}
113117
state = string(kv.Value) == e.nodename
114118
}
115119

0 commit comments

Comments
 (0)