File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/grpc-js-xds/src/xds-stream-state Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export class EdsState extends BaseXdsStreamState<ClusterLoadAssignment__Output>
50
50
*/
51
51
public validateResponse ( message : ClusterLoadAssignment__Output ) {
52
52
const seenLocalities : { locality : Locality__Output , priority : number } [ ] = [ ] ;
53
+ const priorityTotalWeights : Map < number , number > = new Map ( ) ;
53
54
for ( const endpoint of message . endpoints ) {
54
55
if ( ! endpoint . locality ) {
55
56
return false ;
@@ -72,6 +73,12 @@ export class EdsState extends BaseXdsStreamState<ClusterLoadAssignment__Output>
72
73
return false ;
73
74
}
74
75
}
76
+ priorityTotalWeights . set ( endpoint . priority , ( priorityTotalWeights . get ( endpoint . priority ) ?? 0 ) + ( endpoint . load_balancing_weight ?. value ?? 0 ) ) ;
77
+ }
78
+ for ( const totalWeight of priorityTotalWeights . values ( ) ) {
79
+ if ( totalWeight >= 1 << 32 ) {
80
+ return false ;
81
+ }
75
82
}
76
83
return true ;
77
84
}
You can’t perform that action at this time.
0 commit comments