hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hsieh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11537) Avoid synchronization on instances of ConcurrentMap
Date Fri, 18 Jul 2014 22:30:11 GMT

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

Jonathan Hsieh commented on HBASE-11537:
----------------------------------------

Nice.  lgtm.  

I initially thought changing this in the ProcedureCoordinator introduces a may introduce a
potential  race condition. I spent a little while trying to find a race, could not, and have
been convinced that this new implementation is correct.  The only way to insert elements into
procedure is the one location where the putIfAbsent is used prevents insertion races and the
only removes use the remove if equals ilk which prevents accidentally removing the someone
else's insertion race.

Though a bad smell I think the synchronized based approach is still correct.  I'll commit
to master and the older branches the patch applies cleanly to.

> Avoid synchronization on instances of ConcurrentMap
> ---------------------------------------------------
>
>                 Key: HBASE-11537
>                 URL: https://issues.apache.org/jira/browse/HBASE-11537
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Assignee: Mike Drob
>            Priority: Minor
>              Labels: findbugs
>         Attachments: HBASE-11537.patch, HBASE-11537.patch.txt
>
>
> In {{ProcedureCoordinator}} and {{ProcedureMember}} we synchronize on an instance of
{{ConcurrentMap}} instead of using the interface methods for dealing with concurrent access.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message