hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-5549) distcp app should fail if m/r job fails
Date Tue, 30 Jun 2015 05:33:05 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14607531#comment-14607531
] 

Hadoop QA commented on MAPREDUCE-5549:
--------------------------------------

\\
\\
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:red}-1{color} | patch |   0m  0s | The patch command could not apply the patch during
dryrun. |
\\
\\
|| Subsystem || Report/Notes ||
| Patch URL | http://issues.apache.org/jira/secure/attachment/12653802/MAPREDUCE-5549-002.patch
|
| Optional Tests | javadoc javac unit findbugs checkstyle |
| git revision | trunk / d3797f9 |
| Console output | https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/5862/console |


This message was automatically generated.

> 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
>              Labels: BB2015-05-TBR
>         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)

Mime
View raw message