mirror of https://github.com/grpc/grpc-go.git
fix another data race along with goaway
This commit is contained in:
parent
5876dcba5e
commit
a09c6888cc
|
@ -367,6 +367,7 @@ func (cc *ClientConn) newAddrConn(addr Address, skipWait bool) error {
|
||||||
addr: addr,
|
addr: addr,
|
||||||
dopts: cc.dopts,
|
dopts: cc.dopts,
|
||||||
}
|
}
|
||||||
|
ac.stateCV = sync.NewCond(&ac.mu)
|
||||||
ac.dopts.copts.Cancel = make(chan struct{})
|
ac.dopts.copts.Cancel = make(chan struct{})
|
||||||
if EnableTracing {
|
if EnableTracing {
|
||||||
ac.events = trace.NewEventLog("grpc.ClientConn", ac.addr.Addr)
|
ac.events = trace.NewEventLog("grpc.ClientConn", ac.addr.Addr)
|
||||||
|
@ -400,7 +401,6 @@ func (cc *ClientConn) newAddrConn(addr Address, skipWait bool) error {
|
||||||
// ii) a buggy Balancer notifies duplicated Addresses.
|
// ii) a buggy Balancer notifies duplicated Addresses.
|
||||||
stale.tearDown(errConnDrain)
|
stale.tearDown(errConnDrain)
|
||||||
}
|
}
|
||||||
ac.stateCV = sync.NewCond(&ac.mu)
|
|
||||||
// skipWait may overwrite the decision in ac.dopts.block.
|
// skipWait may overwrite the decision in ac.dopts.block.
|
||||||
if ac.dopts.block && !skipWait {
|
if ac.dopts.block && !skipWait {
|
||||||
if err := ac.resetTransport(false); err != nil {
|
if err := ac.resetTransport(false); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue