Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 4DC6610BAF for ; Tue, 27 May 2014 16:50:02 +0000 (UTC) Received: (qmail 33344 invoked by uid 500); 27 May 2014 16:50:02 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 33284 invoked by uid 500); 27 May 2014 16:50:02 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 33275 invoked by uid 99); 27 May 2014 16:50:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2014 16:50:02 +0000 Date: Tue, 27 May 2014 16:50:02 +0000 (UTC) From: "Kousuke Saruta (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MAPREDUCE-5895) FileAlreadyExistsException was thrown : Temporary Index File can not be cleaned up because OutputStream doesn't close properly 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/MAPREDUCE-5895?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kousuke Saruta updated MAPREDUCE-5895: -------------------------------------- Attachment: MAPREDUCE-5895.patch I understood. In the new patch, bos is closed and two cleanup method calls are into one method call. > FileAlreadyExistsException was thrown : Temporary Index File can not be cleaned up because OutputStream doesn't close properly > ------------------------------------------------------------------------------------------------------------------------------ > > Key: MAPREDUCE-5895 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-5895 > Project: Hadoop Map/Reduce > Issue Type: Bug > Components: client > Affects Versions: 3.0.0 > Reporter: Kousuke Saruta > Attachments: MAPREDUCE-5895.patch, MAPREDUCE-5895.patch > > > In TaskLog.java, Temporary Index File is created by following code. > {code} > BufferedOutputStream bos = > new BufferedOutputStream( > SecureIOUtils.createForWrite(tmpIndexFile, 0644)); > DataOutputStream dos = new DataOutputStream(bos); > {code} > The code is surrounded by try-finally so if some Exception/ERROR is thrown between constructing bos and dos, temporary file is not cleaned up. > I met the situation that when a thread ran, OOM was thrown after bos created and temporary file is not cleaned up. At different time, another thread executed same logic and fail because of FileAlreadyExistsException. -- This message was sent by Atlassian JIRA (v6.2#6252)