Skip to content

Commit 4c9777c

Browse files
authored
clusterresolver: fix deadlock when dns resolver responds inline with update or error at build time (#6563)
1 parent 81b9df2 commit 4c9777c

File tree

3 files changed

+194
-211
lines changed

3 files changed

+194
-211
lines changed

xds/internal/balancer/clusterresolver/clusterresolver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (b *clusterResolverBalancer) handleErrorFromUpdate(err error, fromParent bo
280280
// EDS resource was removed. No action needs to be taken for this, and we
281281
// should continue watching the same EDS resource.
282282
if fromParent && xdsresource.ErrType(err) == xdsresource.ErrorTypeResourceNotFound {
283-
b.resourceWatcher.stop()
283+
b.resourceWatcher.stop(false)
284284
}
285285

286286
if b.child != nil {
@@ -326,7 +326,7 @@ func (b *clusterResolverBalancer) run() {
326326
// Close results in stopping the endpoint resolvers and closing the
327327
// underlying child policy and is the only way to exit this goroutine.
328328
case <-b.closed.Done():
329-
b.resourceWatcher.stop()
329+
b.resourceWatcher.stop(true)
330330

331331
if b.child != nil {
332332
b.child.Close()

0 commit comments

Comments
 (0)