Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5759CDAD9 for ; Wed, 12 Dec 2012 19:24:20 +0000 (UTC) Received: (qmail 92541 invoked by uid 500); 12 Dec 2012 19:24:20 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 92499 invoked by uid 500); 12 Dec 2012 19:24:20 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 92490 invoked by uid 99); 12 Dec 2012 19:24:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 19:24:20 +0000 Date: Wed, 12 Dec 2012 19:24:20 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7326) SortedCopyOnWriteSet is not thread safe due to leaked TreeSet implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-7326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13530230#comment-13530230 ] Ted Yu commented on HBASE-7326: ------------------------------- +1 on dropping SortedCopyOnWriteSet > SortedCopyOnWriteSet is not thread safe due to leaked TreeSet implementations > ----------------------------------------------------------------------------- > > Key: HBASE-7326 > URL: https://issues.apache.org/jira/browse/HBASE-7326 > Project: HBase > Issue Type: Bug > Components: util > Affects Versions: 0.92.2, 0.94.3, 0.96.0 > Reporter: Gary Helmling > > The SortedCopyOnWriteSet implementation uses an internal TreeSet that is copied and replaced on mutation operations. However, in a few areas, SortedCopyOnWriteSet leaks references to the underlying TreeSet implementations, allowing for unsafe usage: > * iterator() > * subSet() > * headSet() > * tailSet() > For Iterator.remove(), we can wrap in an implementation that throws UnsupportedOperationException. For the sub set methods, we could return new SortedCopyOnWriteSet instances (which would not modify the parent set), or wrap with a new sub set implementation that safely allows modification of the parent set. > To be clear, the current usage of SortedCopyOnWriteSet does not make use of any of these non-thread-safe methods, but the implementation should be fixed to be completely thread safe and prevent any new issues. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira