removed assert for flakey static stride scheduler with multiple threads (#10437)

on master branch
This commit is contained in:
Tony An 2023-07-31 14:03:00 -07:00 committed by GitHub
parent 944de93f79
commit 3c19325587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 3 deletions

View File

@ -431,9 +431,7 @@ final class WeightedRoundRobinLoadBalancer extends RoundRobinLoadBalancer {
* an offset that varies per backend index is also included to the calculation.
*/
int pick() {
int i = 0;
while (true) {
i++;
long sequence = this.nextSequence();
int backendIndex = (int) (sequence % scaledWeights.length);
long generation = sequence / scaledWeights.length;
@ -442,7 +440,6 @@ final class WeightedRoundRobinLoadBalancer extends RoundRobinLoadBalancer {
if ((weight * generation + offset) % K_MAX_WEIGHT < K_MAX_WEIGHT - weight) {
continue;
}
assert i <= scaledWeights.length : "scheduler has more than one pass through";
return backendIndex;
}
}