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 C1B7E17496 for ; Wed, 11 Mar 2015 23:31:40 +0000 (UTC) Received: (qmail 15372 invoked by uid 500); 11 Mar 2015 23:31:40 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 15316 invoked by uid 500); 11 Mar 2015 23:31:40 -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 15302 invoked by uid 99); 11 Mar 2015 23:31:40 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Mar 2015 23:31:40 +0000 Date: Wed, 11 Mar 2015 23:31:40 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MAPREDUCE-5549) distcp app should fail if m/r job fails 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-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allen Wittenauer updated MAPREDUCE-5549: ---------------------------------------- Target Version/s: 2.6.0, 3.0.0 (was: 3.0.0, 2.6.0) Status: Open (was: Patch Available) > distcp app should fail if m/r job fails > --------------------------------------- > > Key: MAPREDUCE-5549 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-5549 > Project: Hadoop Map/Reduce > Issue Type: Bug > Components: distcp, mrv2 > Affects Versions: 3.0.0 > Reporter: David Rosenstrauch > Attachments: MAPREDUCE-5549-001.patch, MAPREDUCE-5549-002.patch > > > I run distcpv2 in a scripted manner. The script checks if the distcp step fails and, if so, aborts the rest of the script. However, I ran into an issue today where the distcp job failed, but my calling script went on its merry way. > Digging into the code a bit more (at https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java), I think I see the issue: the distcp app is not returning an error exit code to the shell when the distcp job fails. This is a big problem, IMO, as it prevents distcp from being successfully used in a scripted environment. IMO, the code should change like so: > Before: > {code:title=org.apache.hadoop.tools.DistCp.java} > //... > public int run(String[] argv) { > //... > try { > execute(); > } catch (InvalidInputException e) { > LOG.error("Invalid input: ", e); > return DistCpConstants.INVALID_ARGUMENT; > } catch (DuplicateFileException e) { > LOG.error("Duplicate files in input path: ", e); > return DistCpConstants.DUPLICATE_INPUT; > } catch (Exception e) { > LOG.error("Exception encountered ", e); > return DistCpConstants.UNKNOWN_ERROR; > } > return DistCpConstants.SUCCESS; > } > //... > {code} > After: > {code:title=org.apache.hadoop.tools.DistCp.java} > //... > public int run(String[] argv) { > //... > Job job = null; > try { > job = execute(); > } catch (InvalidInputException e) { > LOG.error("Invalid input: ", e); > return DistCpConstants.INVALID_ARGUMENT; > } catch (DuplicateFileException e) { > LOG.error("Duplicate files in input path: ", e); > return DistCpConstants.DUPLICATE_INPUT; > } catch (Exception e) { > LOG.error("Exception encountered ", e); > return DistCpConstants.UNKNOWN_ERROR; > } > if (job.isSuccessful()) { > return DistCpConstants.SUCCESS; > } > else { > return DistCpConstants.UNKNOWN_ERROR; > } > } > //... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)