hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sumitshrestha <rhs4...@gmail.com>
Subject Hbase API: HBaseAdmin.checkHBaseAvailable(config) keeps on attempting connection and throwing exception without ever returning back
Date Fri, 14 Mar 2014 11:00:46 GMT
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 {
        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.

View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-API-HBaseAdmin-checkHBaseAvailable-config-keeps-on-attempting-connection-and-throwing-exceptiok-tp4057062.html
Sent from the HBase User mailing list archive at Nabble.com.

View raw message