Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A96F18ED3 for ; Wed, 23 Dec 2015 18:49:47 +0000 (UTC) Received: (qmail 31139 invoked by uid 500); 23 Dec 2015 18:49:46 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 31083 invoked by uid 500); 23 Dec 2015 18:49:46 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 31060 invoked by uid 99); 23 Dec 2015 18:49:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2015 18:49:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B5DD72C1F54 for ; Wed, 23 Dec 2015 18:49:46 +0000 (UTC) Date: Wed, 23 Dec 2015 18:49:46 +0000 (UTC) From: "Xiao Chen (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-9590) NPE in Storage$StorageDirectory#unlock() 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/HDFS-9590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Chen updated HDFS-9590: ---------------------------- Attachment: HDFS-9590.01.patch > NPE in Storage$StorageDirectory#unlock() > ---------------------------------------- > > Key: HDFS-9590 > URL: https://issues.apache.org/jira/browse/HDFS-9590 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Xiao Chen > Assignee: Xiao Chen > Attachments: HDFS-9590.01.patch > > > The code looks to be possible to have race conditions in multiple-threaded runs. > {code} > public void unlock() throws IOException { > if (this.lock == null) > return; > this.lock.release(); > lock.channel().close(); > lock = null; > } > {code} > This is called in a handful of places, and I don't see any protection. Shall we add some synchronization mechanism? Not sure if I missed any design assumptions here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)