You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by "Riesland, Zack" <Za...@sensus.com> on 2015/09/03 20:51:21 UTC

How to force timeout when connection fails

If I use JDBC to DriverManager.getConnection("myPhoenixURL", myProperties), and HBase is down (say, all the region servers are stopped), it takes a VERY long time to timeout.

In fact, I'm not sure it does. The flow just stops at that statement until I bring HBase back to life.

I tried setting "phoenix.query.timeoutMs" and "phoenix.query.keepAliveMs" to 30000 (in the properties passed when creating the connection), hoping that would force a timeout after 30 seconds, but it doesn't seem to help.

Can someone tell me how to force this to fail quickly, so that I can respond appropriately, instead of basically getting stuck?

Thanks!

Re: How to force timeout when connection fails

Posted by Samarth Jain <sa...@apache.org>.
Zack,

The configs that you overrode do not apply when establishing connection to
HBase via phoenix.
You might want to muck around with hbase.client.retries.number and
zookeeper.recovery.retry
to see if you can get a faster response if HBase is down. I am not an
expert in that area though. Someone from the HBase team should be able to
answer it affirmatively.

- Samarth


On Thu, Sep 3, 2015 at 11:51 AM, Riesland, Zack <Za...@sensus.com>
wrote:

> If I use JDBC to DriverManager.getConnection(“myPhoenixURL”,
> myProperties), and HBase is down (say, all the region servers are stopped),
> it takes a VERY long time to timeout.
>
>
>
> In fact, I’m not sure it does. The flow just stops at that statement until
> I bring HBase back to life.
>
>
>
> I tried setting “phoenix.query.timeoutMs” and “phoenix.query.keepAliveMs”
> to 30000 (in the properties passed when creating the connection), hoping
> that would force a timeout after 30 seconds, but it doesn’t seem to help.
>
>
>
> Can someone tell me how to force this to fail quickly, so that I can
> respond appropriately, instead of basically getting stuck?
>
>
>
> Thanks!
>