Skip to content

Commit e581aad

Browse files
authored
Merge pull request #2227 from murgatroid99/grpc-js-xds_nack_0_total_weight
grpc-js-xds: NACK WeightedCluster if total_weight is 0
2 parents b8c0cdc + 02a43a3 commit e581aad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/grpc-js-xds/src/xds-stream-state/rds-state.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ export class RdsState extends BaseXdsStreamState<RouteConfiguration__Output> imp
8989
}
9090
}
9191
if (route.route!.cluster_specifier === 'weighted_clusters') {
92+
if (route.route.weighted_clusters!.total_weight?.value === 0) {
93+
return false;
94+
}
9295
let weightSum = 0;
9396
for (const clusterWeight of route.route.weighted_clusters!.clusters) {
9497
weightSum += clusterWeight.weight?.value ?? 0;

0 commit comments

Comments
 (0)