Skip to content

Commit

Permalink
Rename to connectionFailedInFirstPass
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Nov 12, 2024
1 parent 11fe515 commit 5c4ff49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ type scData struct {
subConn balancer.SubConn
addr resolver.Address

state connectivity.State
lastErr error
connectionFailed bool
state connectivity.State
lastErr error
connectionFailedInFirstPass bool
}

func (b *pickfirstBalancer) newSCData(addr resolver.Address) (*scData, error) {
Expand Down Expand Up @@ -314,7 +314,7 @@ func (b *pickfirstBalancer) startFirstPassLocked() {
b.numTF = 0
// Reset the connection attempt record for existing SubConns.
for _, sd := range b.subConns.Values() {
sd.(*scData).connectionFailed = false
sd.(*scData).connectionFailedInFirstPass = false
}
b.requestConnectionLocked()
}
Expand Down Expand Up @@ -479,7 +479,7 @@ func (b *pickfirstBalancer) requestConnectionLocked() {
// The SubConn is being re-used and failed during a previous pass
// over the addressList. It has not completed backoff yet.
// Mark it as having failed and try the next address.
scd.connectionFailed = true
scd.connectionFailedInFirstPass = true
lastErr = scd.lastErr
continue
case connectivity.Connecting:
Expand Down Expand Up @@ -534,7 +534,7 @@ func (b *pickfirstBalancer) updateSubConnState(sd *scData, newState balancer.Sub
oldState := sd.state
// Record a connection attempt when exiting CONNECTING.
if newState.ConnectivityState == connectivity.TransientFailure {
sd.connectionFailed = true
sd.connectionFailedInFirstPass = true
}
sd.state = newState.ConnectivityState
// Previously relevant SubConns can still callback with state updates.
Expand Down Expand Up @@ -650,7 +650,7 @@ func (b *pickfirstBalancer) endFirstPassIfPossibleLocked(lastErr error) {
// ended if all the SubConns have reported a failure.
for _, v := range b.subConns.Values() {
sd := v.(*scData)
if !sd.connectionFailed {
if !sd.connectionFailedInFirstPass {
return
}
}
Expand Down

0 comments on commit 5c4ff49

Please sign in to comment.