Skip to content

Commit

Permalink
clusterresolver: fix deadlock when dns resolver responds inline with …
Browse files Browse the repository at this point in the history
…update or error at build time (#6563)
  • Loading branch information
easwars authored Aug 23, 2023
1 parent 81b9df2 commit 4c9777c
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 211 deletions.
4 changes: 2 additions & 2 deletions xds/internal/balancer/clusterresolver/clusterresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (b *clusterResolverBalancer) handleErrorFromUpdate(err error, fromParent bo
// EDS resource was removed. No action needs to be taken for this, and we
// should continue watching the same EDS resource.
if fromParent && xdsresource.ErrType(err) == xdsresource.ErrorTypeResourceNotFound {
b.resourceWatcher.stop()
b.resourceWatcher.stop(false)
}

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

if b.child != nil {
b.child.Close()
Expand Down
Loading

0 comments on commit 4c9777c

Please sign in to comment.