[ 
https://issues.apache.org/jira/browse/TINKERPOP-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15133418#comment-15133418
 ] 

Kieran Sherlock commented on TINKERPOP-1125:
--------------------------------------------


Hi Stephen,

I’m getting a permission denied error when I try to push my new branch to 
github.  Please let me know if I am doing something obviously wrong, otherwise 
please go ahead and apply the patch yourself.


Pingguo-Mac:incubator-tinkerpop $ git status
On branch TINKERPOP-1125
nothing to commit, working directory clean

Pingguo-Mac:incubator-tinkerpop $ git diff origin/tp31
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);
         }

Pingguo-Mac:incubator-tinkerpop $ git push origin TINKERPOP-1125
ERROR: Permission to apache/incubator-tinkerpop.git denied to kieransherlock.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Pingguo-Mac:incubator-tinkerpop $ ssh g...@github.com
PTY allocation request failed on channel 0
Hi kieransherlock! You've successfully authenticated, but GitHub does not 
provide shell access.
Connection to github.com closed.

Thanks,
Kieran.






> 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)

Reply via email to