From 75f1d6890e46d9969b8c69f7db1d093048e7d8bb Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 25 Mar 2021 16:57:43 -0700 Subject: [PATCH] [lds_rds_inline] c1 --- xds/internal/resolver/watch_service.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xds/internal/resolver/watch_service.go b/xds/internal/resolver/watch_service.go index 6c552990939e..b7c04d76b879 100644 --- a/xds/internal/resolver/watch_service.go +++ b/xds/internal/resolver/watch_service.go @@ -115,11 +115,9 @@ func (w *serviceUpdateWatcher) handleLDSResp(update xdsclient.ListenerUpdate, er // inline RDS resource. // If there was an RDS watch, cancel it. - if w.rdsName != "" { - w.rdsName = "" - if w.rdsCancel != nil { - w.rdsCancel() - } + w.rdsName = "" + if w.rdsCancel != nil { + w.rdsCancel() w.rdsCancel = nil } @@ -128,7 +126,9 @@ func (w *serviceUpdateWatcher) handleLDSResp(update xdsclient.ListenerUpdate, er return } - // RDS name from update is not an empty string, start RDS watch. + // RDS name from update is not an empty string, need RDS to fetch the + // routes. + if w.rdsName == update.RouteConfigName { // If the new RouteConfigName is same as the previous, don't cancel and // restart the RDS watch.