[ https://issues.apache.org/jira/browse/TINKERPOP-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134628#comment-15134628 ]
ASF GitHub Bot commented on TINKERPOP-1125: ------------------------------------------- Github user kieransherlock commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/211#issuecomment-180484305 FYI, works on my machine :-) ``` $ mvn clean install -Dci ... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Apache TinkerPop ................................... SUCCESS [ 4.783 s] [INFO] Apache TinkerPop :: Gremlin Shaded ................. SUCCESS [ 2.002 s] [INFO] Apache TinkerPop :: Gremlin Core ................... SUCCESS [ 25.039 s] [INFO] Apache TinkerPop :: Gremlin Test ................... SUCCESS [ 7.232 s] [INFO] Apache TinkerPop :: Gremlin Groovy ................. SUCCESS [ 31.828 s] [INFO] Apache TinkerPop :: Gremlin Groovy Test ............ SUCCESS [ 4.698 s] [INFO] Apache TinkerPop :: TinkerGraph Gremlin ............ SUCCESS [01:32 min] [INFO] Apache TinkerPop :: Hadoop Gremlin ................. SUCCESS [04:58 min] [INFO] Apache TinkerPop :: Spark Gremlin .................. SUCCESS [ 58.823 s] [INFO] Apache TinkerPop :: Giraph Gremlin ................. SUCCESS [ 5.119 s] [INFO] Apache TinkerPop :: Neo4j Gremlin .................. SUCCESS [ 0.983 s] [INFO] Apache TinkerPop :: Gremlin Driver ................. SUCCESS [ 5.888 s] [INFO] Apache TinkerPop :: Gremlin Server ................. SUCCESS [ 5.264 s] [INFO] Apache TinkerPop :: Gremlin Console ................ SUCCESS [ 15.481 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 09:18 min [INFO] Finished at: 2016-02-05T10:23:38-08:00 [INFO] Final Memory: 134M/1520M [INFO] ------------------------------------------------------------------------ ``` > 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)