xds: give up pool lock before closing xdsclient channel, preventing deadlocks with nested xds

This commit is contained in:
Doug Fawley 2025-07-10 15:01:11 -07:00
parent 3d0cb79a78
commit 91c08f46d6
1 changed files with 2 additions and 1 deletions

View File

@ -227,7 +227,6 @@ func (p *Pool) clientRefCountedClose(name string) {
} }
delete(p.clients, name) delete(p.clients, name)
client.Close()
for _, s := range client.bootstrapConfig.XDSServers() { for _, s := range client.bootstrapConfig.XDSServers() {
for _, f := range s.Cleanups() { for _, f := range s.Cleanups() {
f() f()
@ -242,6 +241,8 @@ func (p *Pool) clientRefCountedClose(name string) {
} }
p.mu.Unlock() p.mu.Unlock()
client.Close()
xdsClientImplCloseHook(name) xdsClientImplCloseHook(name)
} }