hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: Hbase API: HBaseAdmin.checkHBaseAvailable(config) keeps on attempting connection and throwing exception without ever returning back
Date Fri, 14 Mar 2014 20:09:43 GMT
On Fri, Mar 14, 2014 at 4:00 AM, sumitshrestha <rhs4shr@gmail.com> wrote:

> I have backend hbase database and need to test whether they are working or
> not. I am using HBaseAdmin.checkHBaseAvailable(config); method to test if
> hbase is running. Here is the code snippet
> try {
>         HBaseAdmin.checkHBaseAvailable(config);
>         return true
>     }
>     catch (ZooKeeperConnectionException zo) {
>         return false
>     }
>     catch (MasterNotRunningException masterNotRunningException) {
>         return false
>     }
>     catch (Exception e) {
>         return false
>     }
> For testing purpose, i stop hbase service and test this method call. As
> defined in document, it should throw exception which I catch and return
> false ending processing. But, actually what happens is that it continues to
> throw zookeeper exception without any end. The function never returns back
> to caller thus causing request to go into a never ending wait cycle. One
> way
> is to maintain a thread that waits for some small period and if reply is
> not
> obtain then returns back killing current thread. But, this seems quite
> hacky
> implementation which I don’t want to implement(any bugs left may lead to
> terrible deadlock). I am still wondering that hbase api deals in such a bad
> way. I am using api version 0.94.10 of apache.
The exception you see is inside checkHBaseAvailable and therein we are
retrying?  Would adjusting timeouts and retries help?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message