-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Description
cleanUpRouteDiscoveryState()
runs cancelXdsResource()
for the old route:
grpc-java/xds/src/main/java/io/grpc/xds/XdsNameResolver.java
Lines 664 to 675 in 486b8ba
cleanUpRouteDiscoveryState(); | |
if (virtualHosts != null) { | |
updateRoutes(virtualHosts, httpConnectionManager.httpMaxStreamDurationNano(), | |
httpConnectionManager.httpFilterConfigs()); | |
} else { | |
routeDiscoveryState = new RouteDiscoveryState( | |
rdsName, httpConnectionManager.httpMaxStreamDurationNano(), | |
httpConnectionManager.httpFilterConfigs()); | |
logger.log(XdsLogLevel.INFO, "Start watching RDS resource {0}", rdsName); | |
xdsClient.watchXdsResource(XdsRouteConfigureResource.getInstance(), | |
rdsName, routeDiscoveryState, syncContext); | |
} |
That means on each LdsUpdate when the route is unchanged, we'll throw away caches for the route and then re-subscribe.
I believe this problem only affects RouteConfigs. Clusters have an incremented ref count before the decrements. Endpoints start a new ClusterResolverLbState within GracefulSwitchLb, which will let the new policy start (and create the watch) before shutting down the old (and canceling the watch).
Since we're currently moving this code for A74, I think we'll just make sure the new code doesn't have this issue.