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-1571) HBaseClient.Connection.sendParam is not synchronized, which may lead to an NPE
Date Tue, 23 Jun 2009 14:13:07 GMT

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

Eugene Kirpichov commented on HBASE-1571:
-----------------------------------------

Moreover, since the sendParam method is not synchronized, there are no visiblity guarantees
on the non-final field 'out'!

(I'm ranting, because I actually received an NPE at that statement, moreover, one that would
not disappear until client restart, and am investigating the possible causes. Most probably
this is not *the* cause, but it could be. When I find out the true cause I'll file another
issue)

> HBaseClient.Connection.sendParam is not synchronized, which may lead to an NPE
> ------------------------------------------------------------------------------
>
>                 Key: HBASE-1571
>                 URL: https://issues.apache.org/jira/browse/HBASE-1571
>             Project: Hadoop HBase
>          Issue Type: Bug
>    Affects Versions: 0.19.2, 0.19.3
>            Reporter: Eugene Kirpichov
>
> Suppose that two threads are concurrently calling HBaseClient.getConnection() to an address
to which no connection has been made yet, or one existed but has been dropped due to an error.
> One of the threads creates a Connection object, puts it into the 'connections' map, and
there, starts doing setupIOStreams, and there goes a context switch.
> The second thread also calls getConnection and gets a connection from the 'connections'
map, whose 'out' stream is only going to be initialized by the second thread, but has not
yet been. There, at synchronized(this.out), goes an NPE.

-- 
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