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

Jean-Daniel Cryans commented on KUDU-1364:
------------------------------------------

I posted a patch but it's not really doing anything, since in 
removeClientFromCache() we remove the TabletClient for the tablets' caches. The 
real problem here is that "location" and "connection" is stored together in a 
single object, so if you lose the connection for any reason you also lose the 
location.

The "easy" solution that comes to mind is just to bump the 5 seconds socket 
read timeout to 10 seconds, so it's aligned with the server. At least 
disconnections won't be as frequent, and two problems become only 1. Setting it 
higher than that would probably not give us much, the server will disconnect us 
anyways.

The more involved solution is to keep connections and tablet locations 
separate. It's medium-size surgery.

Another solution, that I don't really like since it seems racy, is to leverage 
TabletClient.isAlive and keep stale connections in the caches until we replace 
them.

> By default, java client only caches tablet locations for 5 seconds of 
> inactivity
> --------------------------------------------------------------------------------
>
>                 Key: KUDU-1364
>                 URL: https://issues.apache.org/jira/browse/KUDU-1364
>             Project: Kudu
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.7.0
>            Reporter: Mike Percy
>            Assignee: Jean-Daniel Cryans
>
> Reported by [~bruceSz] and [~decster].
> When using the Java client, the tablet locations will only be cached for 5 
> seconds of inactivity before another call to the master is required. This is 
> related to the "socket read timeout" parameter.
> Per Binglin:
> this was "annoying" issue we experienced too :) actually I think it should 
> handle this timeout as normal case(cause master just kicks out idle 
> connection) should not consider this error(and  invalidate caches)
> Workaround:
> {code}
> client = builder
>        .defaultSocketReadTimeoutMs(xxxx)
>        .build();
> {code}
> From the docs:
> {code}org.kududb.client.AsyncKuduClient.AsyncKuduClientBuilder.defaultSocketReadTimeoutMs(long
>  timeoutMs){code}
> Sets the default timeout to use when waiting on data from a socket. Optional. 
> If not provided, defaults to 5s. A value of 0 disables the timeout.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to