mirror of https://github.com/grpc/grpc-java.git
removed assert for flakey static stride scheduler with multiple threads (#10437)
on master branch
This commit is contained in:
parent
944de93f79
commit
3c19325587
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue