[ https://issues.apache.org/jira/browse/TINKERPOP-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134323#comment-15134323 ]
ASF GitHub Bot commented on TINKERPOP-1125: ------------------------------------------- Github user spmallette commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/211#issuecomment-180402242 Glad you figured out how to get that pull request done - cool! A few things: 1. Travis is failing, but i dont think that's your fault - from the looks of the output it seems that Travis just died mid build somehow. I can test the build of your PR manually when the time comes. 1. could you quickly edit the name of your PR to be prefixed with the JIRA issue? That will allow our comments to hook into JIRA nicely for all comments on this ticket. In other words, just change the title to "TINKERPOP-1125 Use the existing Host iterator" 1. Did you run the Gremlin Server integration tests? Basically, after `mvn clean install` you can just do: `mvn verify -DskipIntegrationTests=false -pl gremlin-server`. Those don't get executed by Travis. Sorry for the extra "administrative" work and I can't imagine you've broken anything with this change, but I just would like you to know what our pull request procedure looks like. You can read more about such things here in the contributor docs: http://tinkerpop.apache.org/docs/3.1.0-incubating/developer.html#_pull_request_format Last but not least, the tp31 branch is currently frozen for release of 3.1.1-incubating which will go up for vote on Monday, so we probably won't look to merge this in until that is all settled. Thanks again - please keep the PRs coming. :smile: > RoundRobin load balancing always uses the second Host when size = 2 > ------------------------------------------------------------------- > > Key: TINKERPOP-1125 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1125 > Project: TinkerPop > Issue Type: Bug > Components: driver > Affects Versions: 3.1.0-incubating > Reporter: Kieran Sherlock > Assignee: stephen mallette > Fix For: 3.1.2-incubating > > > Bring up two gremlin-server > Create a Cluster with these two servers, by default > LoadBalancingStrategy.RoundRobin() is used. > Create a client and make queries. > Notice that all requests go to the second server. > this.cluster.loadBalancingStrategy().select(msg).next() is called twice in > Client.chooseConnection(), so always the second Host is used. > The following seems to work > {code:diff} > diff --git > a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java > > b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java > index 8c80b8a..17c9a99 100644 > --- > a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java > +++ > b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java > @@ -341,7 +341,7 @@ public abstract class Client { > final Iterator<Host> possibleHosts = > this.cluster.loadBalancingStrategy().select(msg); > if (!possibleHosts.hasNext()) throw new TimeoutException("Timed > out waiting for an available host."); > - final Host bestHost = > this.cluster.loadBalancingStrategy().select(msg).next(); > + final Host bestHost = possibleHosts.next(); > final ConnectionPool pool = hostConnectionPools.get(bestHost); > return > pool.borrowConnection(cluster.connectionPoolSettings().maxWaitForConnection, > TimeUnit.MILLISECONDS); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)