Skip to content

Commit

Permalink
client: update state earlier to prevent resetTransport calls from kil…
Browse files Browse the repository at this point in the history
…ling good transports (#2862)
  • Loading branch information
dfawley authored Jun 10, 2019
1 parent a5396fd commit a1d4c28
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,9 @@ func (ac *addrConn) connect() error {
ac.mu.Unlock()
return nil
}
// Update connectivity state within the lock to prevent subsequent or
// concurrent calls from resetting the transport more than once.
ac.updateConnectivityState(connectivity.Connecting)
ac.mu.Unlock()

// Start a goroutine connecting to the server asynchronously.
Expand Down

0 comments on commit a1d4c28

Please sign in to comment.