Skip to content

Commit e120c3f

Browse files
authored
internal: transport nil should happen before backoff (#2392)
Seems to fix https://travis-ci.org/grpc/grpc-go/jobs/443409852, but regardless it's a more correct place for it to happen.
1 parent 93a2ad2 commit e120c3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: clientconn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ func (ac *addrConn) resetTransport(resolveNow bool) {
965965
ac.updateConnectivityState(connectivity.TransientFailure)
966966
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
967967
}
968+
ac.transport = nil
968969
ac.mu.Unlock()
969970

970971
if err := ac.nextAddr(); err != nil {
@@ -976,7 +977,6 @@ func (ac *addrConn) resetTransport(resolveNow bool) {
976977
ac.mu.Unlock()
977978
return
978979
}
979-
ac.transport = nil
980980

981981
backoffIdx := ac.backoffIdx
982982
backoffFor := ac.dopts.bs.Backoff(backoffIdx)

0 commit comments

Comments
 (0)