@@ -293,7 +293,6 @@ public void run() {
293293 private <T extends ResourceUpdate > CpcWithFallbackState manageControlPlaneClient (
294294 ResourceSubscriber <T > subscriber ) {
295295
296- ControlPlaneClient activeCpc = getActiveCpc (subscriber .authority );
297296 ControlPlaneClient cpcToUse ;
298297 boolean didFallback = false ;
299298 try {
@@ -313,16 +312,17 @@ private <T extends ResourceUpdate> CpcWithFallbackState manageControlPlaneClient
313312 return new CpcWithFallbackState (null , false );
314313 }
315314
316- if (cpcToUse != activeCpc ) {
315+ ControlPlaneClient activeCpClient = getActiveCpc (subscriber .authority );
316+ if (cpcToUse != activeCpClient ) {
317317 addCpcToAuthority (subscriber .authority , cpcToUse );
318- if (activeCpc != null ) {
318+ if (activeCpClient != null ) {
319319 didFallback = cpcToUse != null && !cpcToUse .isInError ();
320320 if (didFallback ) {
321321 logger .log (XdsLogLevel .INFO , "Falling back to XDS server {0}" ,
322322 cpcToUse .getServerInfo ().target ());
323323 } else {
324324 logger .log (XdsLogLevel .WARNING , "No working fallback XDS Servers found from {0}" ,
325- activeCpc .getServerInfo ().target ());
325+ activeCpClient .getServerInfo ().target ());
326326 }
327327 }
328328 }
@@ -847,7 +847,7 @@ void onData(ParsedResource<T> parsedResource, String version, long updateTime,
847847 processingTracker .startTask ();
848848 executor .execute (() -> {
849849 try {
850- watcher .onResourceChanged (update ); // Call the new method
850+ watcher .onResourceChanged (update );
851851 } finally {
852852 processingTracker .onComplete ();
853853 }
@@ -1033,10 +1033,6 @@ public void handleStreamClosed(Status status, boolean shouldTryFallback) {
10331033 if (!authoritiesForClosedCpc .contains (subscriber .authority )) {
10341034 continue ;
10351035 }
1036- if (subscriber .hasResult ()) {
1037- subscriber .onError (status , null ); // This will become an onAmbientError
1038- continue ;
1039- }
10401036
10411037 // try to fallback to lower priority control plane client
10421038 if (shouldTryFallback && manageControlPlaneClient (subscriber ).didFallback ) {
0 commit comments