From e15d978c827661f8e7cfe807cb9fd8fd8f15a262 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 ab8c94ccf3f7..371405b67972 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))