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 40EE3200B30 for ; Mon, 20 Jun 2016 04:34:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3F80C160A53; Mon, 20 Jun 2016 02:34:12 +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 89663160A64 for ; Mon, 20 Jun 2016 04:34:11 +0200 (CEST) Received: (qmail 80867 invoked by uid 500); 20 Jun 2016 02:34:05 -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 80850 invoked by uid 99); 20 Jun 2016 02:34:05 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2016 02:34:05 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 381DB2C1F5D for ; Mon, 20 Jun 2016 02:34:05 +0000 (UTC) Date: Mon, 20 Jun 2016 02:34:05 +0000 (UTC) From: "Yiqun Lin (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-10549) Memory leak if exception happens when closing DFSOutputStream or DFSStripedOutputStream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 20 Jun 2016 02:34:12 -0000 [ https://issues.apache.org/jira/browse/HDFS-10549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yiqun Lin updated HDFS-10549: ----------------------------- Description: As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{DFSOutputStream}} will not be executed when the IOException happened in {{closeImpl()}}. {code} public void close() throws IOException { synchronized (this) { try (TraceScope ignored = dfsClient.newPathTraceScope("DFSOutputStream#close", src)) { closeImpl(); } } dfsClient.endFileLease(fileId); } } {code} This will cause that the files not be closed in {{DFSClient}} and finally lead to the memory leak. In {{DFSStripedOutputStream}}, it existed the same problem. was: As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{ DFSOutputStream}} will not be executed when the IOException happened in {{closeImpl()}}. {code} public void close() throws IOException { synchronized (this) { try (TraceScope ignored = dfsClient.newPathTraceScope("DFSOutputStream#close", src)) { closeImpl(); } } dfsClient.endFileLease(fileId); } } {code} This will cause that the files not be closed in {{DFSClient}} and finally lead to the memory leak. In {{DFSStripedOutputStream}}, it existed the same problem. > Memory leak if exception happens when closing DFSOutputStream or DFSStripedOutputStream > --------------------------------------------------------------------------------------- > > Key: HDFS-10549 > URL: https://issues.apache.org/jira/browse/HDFS-10549 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client > Affects Versions: 2.7.1 > Reporter: Yiqun Lin > Assignee: Yiqun Lin > Attachments: HDFS-10549.001.patch > > > As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{DFSOutputStream}} will not be executed when the IOException happened in {{closeImpl()}}. > {code} > public void close() throws IOException { > synchronized (this) { > try (TraceScope ignored = > dfsClient.newPathTraceScope("DFSOutputStream#close", src)) { > closeImpl(); > } > } > dfsClient.endFileLease(fileId); > } > } > {code} > This will cause that the files not be closed in {{DFSClient}} and finally lead to the memory leak. In {{DFSStripedOutputStream}}, it existed the same problem. -- 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