File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -918,12 +918,8 @@ func (ac *addrConn) connect() error {
918918 ac .mu .Unlock ()
919919 return nil
920920 }
921- // Update the state to ensure no concurrent requests start once the lock
922- // is released.
923- ac .updateConnectivityState (connectivity .Connecting , nil )
924- ac .mu .Unlock ()
925921
926- ac .resetTransport ()
922+ ac .resetTransportAndUnlock ()
927923 return nil
928924}
929925
@@ -995,11 +991,9 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) {
995991 ac .updateConnectivityState (connectivity .Idle , nil )
996992 }
997993
998- ac .mu .Unlock ()
999-
1000994 // Since we were connecting/connected, we should start a new connection
1001995 // attempt.
1002- go ac .resetTransport ()
996+ go ac .resetTransportAndUnlock ()
1003997}
1004998
1005999// getServerName determines the serverName to be used in the connection
@@ -1234,8 +1228,7 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) {
12341228 }
12351229}
12361230
1237- func (ac * addrConn ) resetTransport () {
1238- ac .mu .Lock ()
1231+ func (ac * addrConn ) resetTransportAndUnlock () {
12391232 acCtx := ac .ctx
12401233 if acCtx .Err () != nil {
12411234 ac .mu .Unlock ()
You can’t perform that action at this time.
0 commit comments