xds/cdsbalancer: move xds client close to run() (#4273)

Otherwise client may be used by run() after closed.
This commit is contained in:
Menghan Li 2021-03-16 14:50:07 -07:00 committed by GitHub
parent 95173a53fe
commit 967933baf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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