Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-9485 RoundRobinBalancingStrategy always starts from server 0 #6236

Merged
merged 1 commit into from Sep 7, 2018

Conversation

danberindei
Copy link
Member

@@ -28,7 +29,7 @@ public void setServers(Collection<SocketAddress> servers) {
this.servers = servers.toArray(new SocketAddress[servers.size()]);
// keep the old index if possible so that we don't produce more requests for the first server
if (index >= this.servers.length) {
index = 0;
index = ThreadLocalRandom.current().nextInt(this.servers.length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't index be initialized to MAX_INT in order to trigger this on 1st call ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I meant to remove the if

@danberindei
Copy link
Member Author

Updated to remove the if and to fix the test

@wburns wburns merged commit 8770b6e into infinispan:master Sep 7, 2018
@wburns
Copy link
Member

wburns commented Sep 7, 2018

Integrated into master, thanks @danberindei !

@danberindei danberindei deleted the ISPN-9485_round_robin branch September 8, 2018 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants