Skip to content

XdsNameResolver unsubscribes from old route before subscribing to new route #11745

Open
@ejona86

Description

@ejona86

cleanUpRouteDiscoveryState() runs cancelXdsResource() for the old route:

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions