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

Jonathan Hsieh commented on HBASE-11313:
----------------------------------------

Nice catch -- on my read I thought the default was Resuable.  I was in this 
code recently and working on a writeup / revamp.

I really thing we should instead remove both the reusable and threadlocal 
options.  

* Round robind looks reasonable -- asking for a connection from the pool would 
either create a new one or return an existing one.
* My read of reusable is that it doesn't actually bound the number of 
connections created.  It only caches a few and only reuses the connection if 
they are returned.  Otherwise new uncached client-rs connections are created! 
[1]   These uncached ones cannot be interrupted or cancelled and would likely 
cause hangs.
* Thread local is dangerous (will leak connections if not handled correctly) 
and hard to use correctly.  In some client tests using this frequently causes 
hangs, likely due to threads that hang around.

[1] 
https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClient.java#L1567


> RpcClient should allow Reusable pool option.
> --------------------------------------------
>
>                 Key: HBASE-11313
>                 URL: https://issues.apache.org/jira/browse/HBASE-11313
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.99.0, 0.98.3
>            Reporter: Jean-Marc Spaggiari
>            Assignee: Jean-Marc Spaggiari
>            Priority: Minor
>         Attachments: HBASE-11313-v0-trunk.patch
>
>
> RpcClient.getPoolType check the pool choice against ThreadLocal and 
> RoundRobin. However, we have a 3rd pooltype already in, Reusable. We should 
> allow in this getPoolType check.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to