client: update state earlier to prevent resetTransport calls from killing good transports (#2862)

This commit is contained in:
Doug Fawley 2019-06-10 16:58:43 -07:00 committed by GitHub
parent a5396fd45c
commit a1d4c283c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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.