fix the zookeper race (#4355)

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
Krasi Georgiev 2018-07-06 10:39:38 +03:00 committed by Brian Brazil
parent 9fe8bcf4be
commit a155b6d29d
1 changed files with 5 additions and 2 deletions

View File

@ -137,8 +137,11 @@ func NewDiscovery(
logger = log.NewNopLogger() logger = log.NewNopLogger()
} }
conn, _, err := zk.Connect(srvs, timeout) conn, _, err := zk.Connect(
conn.SetLogger(treecache.NewZookeeperLogger(logger)) srvs, timeout,
func(c *zk.Conn) {
c.SetLogger(treecache.NewZookeeperLogger(logger))
})
if err != nil { if err != nil {
return nil return nil
} }