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
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.