Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3FE53200BEC for ; Thu, 29 Dec 2016 10:09:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3E97C160B15; Thu, 29 Dec 2016 09:09:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8FBAC160B40 for ; Thu, 29 Dec 2016 10:08:59 +0100 (CET) Received: (qmail 54227 invoked by uid 500); 29 Dec 2016 09:08:58 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 54026 invoked by uid 99); 29 Dec 2016 09:08:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2016 09:08:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7EE402C2A67 for ; Thu, 29 Dec 2016 09:08:58 +0000 (UTC) Date: Thu, 29 Dec 2016 09:08:58 +0000 (UTC) From: "Lei (Eddy) Xu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-11267) Avoid redefinition of storageDirs in NNStorage and cleanup its accessors in Storage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 29 Dec 2016 09:09:00 -0000 [ https://issues.apache.org/jira/browse/HDFS-11267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lei (Eddy) Xu updated HDFS-11267: --------------------------------- Target Version/s: 2.9.0, 3.0.0-alpha2 Status: Patch Available (was: Open) > Avoid redefinition of storageDirs in NNStorage and cleanup its accessors in Storage > ----------------------------------------------------------------------------------- > > Key: HDFS-11267 > URL: https://issues.apache.org/jira/browse/HDFS-11267 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 3.0.0-alpha1 > Reporter: Manoj Govindassamy > Assignee: Manoj Govindassamy > Attachments: HDFS-11267.01.patch, HDFS-11267.02.patch > > > In the abstract class {{Storage}}, {{storageDirs}} is a protected variable and all its derived classes like {{NNStorage}}, {{JNStorage}}, {{DataStorage}}.. are iterating over this non-thread safe variable without any proper locks. Any parallel modification operation like add or remove volume can mutate the backing storageDirs list and any iterators on this list around the same time can face {{ConcurrentModificationException}}. It would be good to make the variable private and restrict the access via getters and setters. Any thread safe restriction need to be done can then be placed on the parent class only. > Also, {{NNStorage}} redefines parent class Storage's {{storageDirs}}, making it inconsistent with other derived classes. Would be cleaner if {{NNStorage}} can avoid re-defining it locally. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org