diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index ca03caa139..9634d0c3a3 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1114,6 +1114,9 @@ Release 0.23.9 - UNRELEASED MAPREDUCE-5308. Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs (Nathan Roberts via jlowe) + MAPREDUCE-5315. DistCp reports success even on failure. (mithun and jlowe + via daryn) + Release 0.23.8 - 2013-06-05 INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java index 2452efa86e..06d71047dd 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java @@ -162,8 +162,9 @@ public Job execute() throws Exception { job.getConfiguration().set(DistCpConstants.CONF_LABEL_DISTCP_JOB_ID, jobID); LOG.info("DistCp job-id: " + jobID); - if (inputOptions.shouldBlock()) { - job.waitForCompletion(true); + if (inputOptions.shouldBlock() && !job.waitForCompletion(true)) { + throw new IOException("DistCp failure: Job " + jobID + " has failed: " + + job.getStatus().getFailureInfo()); } return job; }