Skip to content

Commit 38e0a0f

Browse files
(backport v1.57) removed assert statement for static stride scheduler with multiple threads (#10438)
1 parent 503883b commit 38e0a0f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,7 @@ long getSequence() {
431431
* an offset that varies per backend index is also included to the calculation.
432432
*/
433433
int pick() {
434-
int i = 0;
435434
while (true) {
436-
i++;
437435
long sequence = this.nextSequence();
438436
int backendIndex = (int) (sequence % scaledWeights.length);
439437
long generation = sequence / scaledWeights.length;
@@ -442,7 +440,6 @@ int pick() {
442440
if ((weight * generation + offset) % K_MAX_WEIGHT < K_MAX_WEIGHT - weight) {
443441
continue;
444442
}
445-
assert i <= scaledWeights.length : "scheduler has more than one pass through";
446443
return backendIndex;
447444
}
448445
}

0 commit comments

Comments
 (0)