This closes #3831
This commit is contained in:
commit
e37f2ac05e
|
@ -31,17 +31,14 @@ public final class RoundRobinConnectionLoadBalancingPolicy implements Connection
|
||||||
|
|
||||||
private static final long serialVersionUID = 7511196010141439559L;
|
private static final long serialVersionUID = 7511196010141439559L;
|
||||||
|
|
||||||
private boolean first = true;
|
private int pos = -1;
|
||||||
|
|
||||||
private int pos;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int select(final int max) {
|
public int select(final int max) {
|
||||||
if (first) {
|
if (pos == -1) {
|
||||||
// We start on a random one
|
// We start on a random one
|
||||||
pos = RandomUtil.randomInterval(0, max);
|
pos = RandomUtil.randomInterval(0, max);
|
||||||
|
|
||||||
first = false;
|
|
||||||
} else {
|
} else {
|
||||||
pos++;
|
pos++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue