hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Kirpichov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-1604) HBaseClient.getConnection() may return a broken connection without throwing an exception
Date Wed, 15 Jul 2009 18:16:14 GMT

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

Eugene Kirpichov commented on HBASE-1604:
-----------------------------------------

Oops. Sorry, the patch is indeed reversed; I want to throw the exception. Should I re-upload
a correct version?

I have run into this issue and traced it in a debugger: indeed, broken connections were being
returned after a regionserver restart, and this issue disappeared when I rethrew the exception.

> HBaseClient.getConnection() may return a broken connection without throwing an exception
> ----------------------------------------------------------------------------------------
>
>                 Key: HBASE-1604
>                 URL: https://issues.apache.org/jira/browse/HBASE-1604
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.19.2
>            Reporter: Eugene Kirpichov
>         Attachments: hbase-1604.patch
>
>
> Consider the code of HBaseClient.getConnection():
> {code}
>     connection.setupIOstreams();
>     return connection;
>   }
> {code}
> Now consider the setupIOstreams() method:
> {code}
>       } catch (IOException e) {
>         markClosed(e);
>         close(); // Removes the connection from pool
>       }
> {code}
> So, if something goes wrong inside of setupIOstreams, then after its invocation the connection
will be broken (will have its .in and .out streams nulls, for example) and will not be in
pool, but will still be returned from the getConnection method and cause further harm (for
example, cause a NullPointerException in further calls such as sendCall, which use the in
and out streams).
> Suggested fix: make the setupIOstreams method rethrow the IOException inside that catch
block.
> Reproduction: Restart the hbase master and/or regionserver while a client program is
running, and put a breakpoint into that catch block.
> I actually observed a situation where the broken connection stayed in the pool, but I
don't yet know how to reproduce it or what is the reason. I am investigating the issue, but
for now at least the aforementioned bug should be fixed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message