mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1925 from murgatroid99/grpc-js-xds_incremental_update_fix
grpc-js-xds: Fix RDS and EDS missing resource handling
This commit is contained in:
commit
e5a13a5828
|
@ -163,7 +163,6 @@ export class EdsState implements XdsStreamState<ClusterLoadAssignment__Output> {
|
|||
}
|
||||
}
|
||||
trace('Received EDS updates for cluster names ' + Array.from(allClusterNames));
|
||||
this.handleMissingNames(allClusterNames);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,8 +163,13 @@ export class LdsState implements XdsStreamState<Listener__Output> {
|
|||
this.latestResponses = responses;
|
||||
this.latestIsV2 = isV2;
|
||||
const allTargetNames = new Set<string>();
|
||||
const allRouteConfigNames = new Set<string>();
|
||||
for (const message of responses) {
|
||||
allTargetNames.add(message.name);
|
||||
const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL_V3, message.api_listener!.api_listener!.value);
|
||||
if (httpConnectionManager.rds) {
|
||||
allRouteConfigNames.add(httpConnectionManager.rds.route_config_name);
|
||||
}
|
||||
const watchers = this.watchers.get(message.name) ?? [];
|
||||
for (const watcher of watchers) {
|
||||
watcher.onValidUpdate(message, isV2);
|
||||
|
@ -172,6 +177,7 @@ export class LdsState implements XdsStreamState<Listener__Output> {
|
|||
}
|
||||
trace('Received RDS response with route config names ' + Array.from(allTargetNames));
|
||||
this.handleMissingNames(allTargetNames);
|
||||
this.rdsState.handleMissingNames(allRouteConfigNames);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
|
|||
return true;
|
||||
}
|
||||
|
||||
private handleMissingNames(allRouteConfigNames: Set<string>) {
|
||||
handleMissingNames(allRouteConfigNames: Set<string>) {
|
||||
for (const [routeConfigName, watcherList] of this.watchers.entries()) {
|
||||
if (!allRouteConfigNames.has(routeConfigName)) {
|
||||
for (const watcher of watcherList) {
|
||||
|
@ -200,7 +200,6 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
|
|||
}
|
||||
}
|
||||
trace('Received RDS response with route config names ' + Array.from(allRouteConfigNames));
|
||||
this.handleMissingNames(allRouteConfigNames);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue