Merge pull request #564 from iamqizhao/master
Fix a race between transport creation and wait returning
This commit is contained in:
@ -539,8 +539,9 @@ func (cc *Conn) Wait(ctx context.Context) (transport.ClientTransport, error) {
|
||||
cc.mu.Unlock()
|
||||
return nil, ErrClientConnClosing
|
||||
case cc.state == Ready:
|
||||
ct := cc.transport
|
||||
cc.mu.Unlock()
|
||||
return cc.transport, nil
|
||||
return ct, nil
|
||||
default:
|
||||
ready := cc.ready
|
||||
if ready == nil {
|
||||
|
Reference in New Issue
Block a user