We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da94cd3 commit e972348Copy full SHA for e972348
1 file changed
volo/src/loadbalance/random.rs
@@ -19,6 +19,9 @@ fn pick_one(
19
if sum_of_weight == 0 {
20
return None;
21
}
22
+ if instances.len() == 0 {
23
+ return None;
24
+ }
25
let weight = rand::rng().random_range(0..sum_of_weight);
26
let index = prefix_sum_of_weights
27
.binary_search(&weight)
0 commit comments