Skip to content

Commit 1588fd2

Browse files
committed
add back internal client related cleanup operations
1 parent c0a8c38 commit 1588fd2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

xds/internal/xdsclient/pool.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,22 @@ func (p *Pool) clientRefCountedClose(name string) {
226226
return
227227
}
228228
delete(p.clients, name)
229-
p.mu.Unlock()
230229

231-
// This attempts to close the transport to the management server and could
232-
// theoretically call back into the xdsclient package again and deadlock.
233-
// Hence, this needs to be called without holding the lock.
234230
client.Close()
231+
for _, s := range client.config.XDSServers() {
232+
for _, f := range s.Cleanups() {
233+
f()
234+
}
235+
}
236+
for _, a := range client.config.Authorities() {
237+
for _, s := range a.XDSServers {
238+
for _, f := range s.Cleanups() {
239+
f()
240+
}
241+
}
242+
}
243+
p.mu.Unlock()
244+
235245
xdsClientImplCloseHook(name)
236246
}
237247

0 commit comments

Comments
 (0)