From a32d2778f37bfc7260b4a9130f9ae0767a70d3d3 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Mon, 13 Dec 2021 13:56:30 -0800 Subject: [PATCH] xds/client: send connection errors to all watchers (#5054) --- xds/internal/xdsclient/pubsub/update.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xds/internal/xdsclient/pubsub/update.go b/xds/internal/xdsclient/pubsub/update.go index ab8c94ccf..371405b67 100644 --- a/xds/internal/xdsclient/pubsub/update.go +++ b/xds/internal/xdsclient/pubsub/update.go @@ -295,6 +295,21 @@ func (pb *Pubsub) NewConnectionError(err error) { pb.mu.Lock() defer pb.mu.Unlock() + for _, s := range pb.ldsWatchers { + for wi := range s { + wi.newError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err)) + } + } + for _, s := range pb.rdsWatchers { + for wi := range s { + wi.newError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err)) + } + } + for _, s := range pb.cdsWatchers { + for wi := range s { + wi.newError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err)) + } + } for _, s := range pb.edsWatchers { for wi := range s { wi.newError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err))