maintenance.go (etcd-3.5.5) | : | maintenance.go (etcd-3.5.6) | ||
---|---|---|---|---|
skipping to change at line 95 | skipping to change at line 95 | |||
//get token with established connection | //get token with established connection | |||
dctx := c.ctx | dctx := c.ctx | |||
cancel := func() {} | cancel := func() {} | |||
if c.cfg.DialTimeout > 0 { | if c.cfg.DialTimeout > 0 { | |||
dctx, cancel = context.WithTimeout(c.ctx, c.cfg.D ialTimeout) | dctx, cancel = context.WithTimeout(c.ctx, c.cfg.D ialTimeout) | |||
} | } | |||
err = c.getToken(dctx) | err = c.getToken(dctx) | |||
cancel() | cancel() | |||
if err != nil { | if err != nil { | |||
conn.Close() | ||||
return nil, nil, fmt.Errorf("failed to getToken f rom endpoint %s with maintenance client: %v", endpoint, err) | return nil, nil, fmt.Errorf("failed to getToken f rom endpoint %s with maintenance client: %v", endpoint, err) | |||
} | } | |||
cancel = func() { conn.Close() } | cancel = func() { conn.Close() } | |||
return RetryMaintenanceClient(c, conn), cancel, nil | return RetryMaintenanceClient(c, conn), cancel, nil | |||
}, | }, | |||
remote: RetryMaintenanceClient(c, c.conn), | remote: RetryMaintenanceClient(c, c.conn), | |||
} | } | |||
if c != nil { | if c != nil { | |||
api.callOpts = c.callOpts | api.callOpts = c.callOpts | |||
} | } | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added |