Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 6 additions & 25 deletions internal/balancergroup/balancergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,14 @@
}
}

// exitIdle invokes the sub-balancer's ExitIdle method. Returns a boolean
// indicating whether or not the operation was completed.
func (sbc *subBalancerWrapper) exitIdle() (complete bool) {
// exitIdle invokes the ExitIdle method on the sub-balancer, a gracefulswitch
// balancer.
func (sbc *subBalancerWrapper) exitIdle() {
b := sbc.balancer
if b == nil {
return true
return

Check warning on line 114 in internal/balancergroup/balancergroup.go

View check run for this annotation

Codecov / codecov/patch

internal/balancergroup/balancergroup.go#L114

Added line #L114 was not covered by tests
}
b.ExitIdle()
return true
}

func (sbc *subBalancerWrapper) updateClientConnState(s balancer.ClientConnState) error {
Expand Down Expand Up @@ -411,20 +410,6 @@
}
}

// connect attempts to connect to all subConns belonging to sb.
func (bg *BalancerGroup) connect(sb *subBalancerWrapper) {
bg.incomingMu.Lock()
defer bg.incomingMu.Unlock()
if bg.incomingClosed {
return
}
for sc, b := range bg.scToSubBalancer {
if b == sb {
sc.Connect()
}
}
}

Comment on lines -414 to -427
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed here, it fails CI-test because it's unused.
image

// Following are actions from the parent grpc.ClientConn, forward to sub-balancers.

// updateSubConnState forwards the update to cb and updates scToSubBalancer if
Expand Down Expand Up @@ -575,9 +560,7 @@
return
}
for _, config := range bg.idToBalancerConfig {
if !config.exitIdle() {
bg.connect(config)
}
config.exitIdle()
}
}

Expand All @@ -590,9 +573,7 @@
return
}
if config := bg.idToBalancerConfig[id]; config != nil {
if !config.exitIdle() {
bg.connect(config)
}
config.exitIdle()
}
}

Expand Down