Skip to content

Commit

Permalink
xds/cdsbalancer: move xds client close to run() (#4273)
Browse files Browse the repository at this point in the history
Otherwise client may be used by run() after closed.
  • Loading branch information
menghanl committed Mar 16, 2021
1 parent 95173a5 commit 967933b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xds/internal/balancer/cdsbalancer/cdsbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ func (b *cdsBalancer) run() {
b.edsLB.Close()
b.edsLB = nil
}
b.xdsClient.Close()
// This is the *ONLY* point of return from this function.
b.logger.Infof("Shutdown")
return
Expand Down Expand Up @@ -493,7 +494,6 @@ func (b *cdsBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.Sub
// Close closes the cdsBalancer and the underlying edsBalancer.
func (b *cdsBalancer) Close() {
b.closed.Fire()
b.xdsClient.Close()
}

// ccWrapper wraps the balancer.ClientConn passed to the CDS balancer at
Expand Down

0 comments on commit 967933b

Please sign in to comment.