Skip to content

Commit

Permalink
Merge pull request #7228 from Johnny-Three/fixzkrelatedcmdhangwhenzkdown
Browse files Browse the repository at this point in the history
fix meta data related operation hang when zk down
  • Loading branch information
sougou authored Dec 28, 2020
2 parents 4df037d + 2c2e8f2 commit 81719f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/vt/topo/zk2topo/zk_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ func (c *ZkConn) handleSessionEvents(conn *zk.Conn, session <-chan zk.Event) {
func dialZk(ctx context.Context, addr string) (*zk.Conn, <-chan zk.Event, error) {
servers := strings.Split(addr, ",")
dialer := zk.WithDialer(net.DialTimeout)
ctx, cancel := context.WithTimeout(ctx, *baseTimeout)
defer cancel()
// If TLS is enabled use a TLS enabled dialer option
if *certPath != "" && *keyPath != "" {
if strings.Contains(addr, ",") {
Expand Down

0 comments on commit 81719f4

Please sign in to comment.