You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Lars Hofhansl (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/01/02 07:05:31 UTC

[jira] [Issue Comment Edited] (HBASE-5088) A concurrency issue on SoftValueSortedMap

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

Lars Hofhansl edited comment on HBASE-5088 at 1/2/12 6:04 AM:
--------------------------------------------------------------

@Jieshan: What do you think of my attached 5088.generics.txt patch?

It switches TreeMap with ConcurrentSkipListMap and also:
* fixes all generics warnings
* uses proper interfaces instead of concrete classes
* removes all synchronization (should not be necessary with the inner map being a ConcurrentSkipListMap).

                
      was (Author: lhofhansl):
    @Jieshan: What do you think of my attached 5088.generics.txt patch?

It switches TreeMap with ConcurrentSkipListMap and also:
* fixes are generics warnings
* uses proper interface instead of concrete classes
* remove all synchronization (should not be necessary with the inner map being ConcurrentSkipListMap).

                  
> A concurrency issue on SoftValueSortedMap
> -----------------------------------------
>
>                 Key: HBASE-5088
>                 URL: https://issues.apache.org/jira/browse/HBASE-5088
>             Project: HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.90.4, 0.94.0
>            Reporter: Jieshan Bean
>            Assignee: Jieshan Bean
>         Attachments: 5088-useMapInterfaces.txt, 5088.generics.txt, HBase-5088-90.patch, HBase-5088-trunk.patch, HBase5088Reproduce.java
>
>
> SoftValueSortedMap is backed by a TreeMap. All the methods in this class are synchronized. If we use this method to add/delete elements, it's ok.
> But in HConnectionManager#getCachedLocation, it use headMap to get a view from SoftValueSortedMap#internalMap. Once we operate 
> on this view map(like add/delete) in other threads, a concurrency issue may occur.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira