We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 503883b commit 38e0a0fCopy full SHA for 38e0a0f
xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java
@@ -431,9 +431,7 @@ long getSequence() {
431
* an offset that varies per backend index is also included to the calculation.
432
*/
433
int pick() {
434
- int i = 0;
435
while (true) {
436
- i++;
437
long sequence = this.nextSequence();
438
int backendIndex = (int) (sequence % scaledWeights.length);
439
long generation = sequence / scaledWeights.length;
@@ -442,7 +440,6 @@ int pick() {
442
440
if ((weight * generation + offset) % K_MAX_WEIGHT < K_MAX_WEIGHT - weight) {
443
441
continue;
444
}
445
- assert i <= scaledWeights.length : "scheduler has more than one pass through";
446
return backendIndex;
447
448
0 commit comments