[ 
https://issues.apache.org/jira/browse/HBASE-11537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike Drob updated HBASE-11537:
------------------------------

    Attachment: HBASE-11537.patch.txt

This patch swaps out the use of synchronization on a {{ConcurrentMap}} with 
calls to {{putIfAbsent}} and the conditional {{remove}}.

We also remove a dead store of the result of {{pool.submit()}} since we return 
from the method immediately. And remove the unreachable null check in the catch 
block because if something threw an exception then it's not possible for the 
given {{Future}} to have been assigned.

I'm not sure how to write additional tests for this, but the existing tests 
pass for me. Would love to hear feedback.

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

Reply via email to