Skip to content

Commit 13a9fd8

Browse files
added check argument for edge case: no weights inputted
1 parent d99d51a commit 13a9fd8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,7 @@ static final class StaticStrideScheduler {
490490
maxWeight = Math.max(weight, maxWeight);
491491
}
492492

493-
// checkArgument(numChannels <= 1, "Couldn't build scheduler: requires at least two weights");
494-
// checkArgument(numZeroWeightChannels == numChannels, "Couldn't build scheduler: only zero
495-
// weights"); // checks break code
493+
checkArgument(numChannels >= 1, "Couldn't build scheduler: requires at least one weight");
496494

497495
double scalingFactor = K_MAX_WEIGHT / maxWeight;
498496
long meanWeight =

0 commit comments

Comments
 (0)