Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ejona86 opened this issue Dec 12, 2024 · 0 comments
Open
Assignees
Labels
Milestone

Comments

@ejona86
Copy link
Member

ejona86 commented Dec 12, 2024

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.

@ejona86 ejona86 added the bug label Dec 12, 2024
@ejona86 ejona86 added this to the Next milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants