hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben West (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-5290) [FindBugs] Synchronization on boxed primitive
Date Mon, 30 Jan 2012 19:04:10 GMT

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

Ben West updated HBASE-5290:

    Affects Version/s: 0.94.0
               Status: Patch Available  (was: Open)

The issue is deadlock, so it's kind of hard to write a good test, but I verified that the
three tests failed before my patch and passed after.
> [FindBugs] Synchronization on boxed primitive
> ---------------------------------------------
>                 Key: HBASE-5290
>                 URL: https://issues.apache.org/jira/browse/HBASE-5290
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.94.0
>            Reporter: Liyin Tang
>            Assignee: Liyin Tang
>            Priority: Minor
> This bug is reported by the findBugs tool, which is a static analysis tool.
> Bug: Synchronization on Integer in org.apache.hadoop.hbase.regionserver.compactions.CompactSelection.emptyFileList()
> The code synchronizes on a boxed primitive constant, such as an Integer.
> private static Integer count = 0;
> ...
>   synchronized(count) {
>      count++;
>      }
> ...
> Since Integer objects can be cached and shared, this code could be synchronizing on the
same object as other, unrelated code, leading to unresponsiveness and possible deadlock
> See CERT CON08-J. Do not synchronize on objects that may be reused for more information.
> Confidence: Normal, Rank: Troubling (14)
> Type: DL, Category: MT_CORRECTNESS (Multithreaded correctness)

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


View raw message