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 953EC19F74 for ; Tue, 1 Mar 2016 12:22:34 +0000 (UTC) Received: (qmail 82835 invoked by uid 500); 1 Mar 2016 12:22:18 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 82759 invoked by uid 500); 1 Mar 2016 12:22:18 -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 82642 invoked by uid 99); 1 Mar 2016 12:22:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2016 12:22:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 16B972C1F5D for ; Tue, 1 Mar 2016 12:22:18 +0000 (UTC) Date: Tue, 1 Mar 2016 12:22:18 +0000 (UTC) From: "Kai Sasaki (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-6607) .staging dir is not cleaned up if mapreduce.task.files.preserve.failedtask or mapreduce.task.files.preserve.filepattern are set 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-6607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173677#comment-15173677 ] Kai Sasaki commented on MAPREDUCE-6607: --------------------------------------- [~ozawa] Sorry for bothering but could you review it again please? > .staging dir is not cleaned up if mapreduce.task.files.preserve.failedtask or mapreduce.task.files.preserve.filepattern are set > ------------------------------------------------------------------------------------------------------------------------------- > > Key: MAPREDUCE-6607 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-6607 > Project: Hadoop Map/Reduce > Issue Type: Bug > Components: applicationmaster > Affects Versions: 2.7.1 > Reporter: Maysam Yabandeh > Assignee: Kai Sasaki > Priority: Minor > Attachments: MAPREDUCE-6607.01.patch, MAPREDUCE-6607.02.patch, MAPREDUCE-6607.03.patch > > > if either of the following configs are set, then .staging dir is not cleaned up: > * mapreduce.task.files.preserve.failedtask > * mapreduce.task.files.preserve.filepattern > The former was supposed to keep only .staging of failed tasks and the latter was supposed to be used only if that task name matches against the specified regular expression. > {code} > protected boolean keepJobFiles(JobConf conf) { > return (conf.getKeepTaskFilesPattern() != null || conf > .getKeepFailedTaskFiles()); > } > {code} > {code} > public void cleanupStagingDir() throws IOException { > /* make sure we clean the staging files */ > String jobTempDir = null; > FileSystem fs = getFileSystem(getConfig()); > try { > if (!keepJobFiles(new JobConf(getConfig()))) { > jobTempDir = getConfig().get(MRJobConfig.MAPREDUCE_JOB_DIR); > if (jobTempDir == null) { > LOG.warn("Job Staging directory is null"); > return; > } > Path jobTempDirPath = new Path(jobTempDir); > LOG.info("Deleting staging directory " + FileSystem.getDefaultUri(getConfig()) + > " " + jobTempDir); > fs.delete(jobTempDirPath, true); > } > } catch(IOException io) { > LOG.error("Failed to cleanup staging dir " + jobTempDir, io); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)