From afeff43d7aabeda582326a89ef2d415792e13094 Mon Sep 17 00:00:00 2001 From: Jason Darrell Lowe Date: Wed, 3 Jul 2013 14:46:54 +0000 Subject: [PATCH] svn merge -c 1499425 FIXES: MAPREDUCE-5358. MRAppMaster throws invalid transitions for JobImpl. Contributed by Devaraj K git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1499426 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../apache/hadoop/mapreduce/v2/app/job/impl/JobImpl.java | 4 +++- .../hadoop/mapreduce/v2/app/job/impl/TestJobImpl.java | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 0abe0147acf..9ab23e012d5 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -18,6 +18,9 @@ Release 2.3.0 - UNRELEASED MAPREDUCE-3193. FileInputFormat doesn't read files recursively in the input path dir (Devaraj K via jlowe) + MAPREDUCE-5358. MRAppMaster throws invalid transitions for JobImpl + (Devaraj K via jlowe) + Release 2.2.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/JobImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/JobImpl.java index 3d54273bf22..2c33650de41 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/JobImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/JobImpl.java @@ -420,7 +420,9 @@ public class JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job, EnumSet.of(JobEventType.JOB_KILL, JobEventType.JOB_UPDATED_NODES, JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE, - JobEventType.JOB_AM_REBOOT)) + JobEventType.JOB_AM_REBOOT, + JobEventType.JOB_TASK_ATTEMPT_COMPLETED, + JobEventType.JOB_MAP_TASK_RESCHEDULED)) // Transitions from FAIL_ABORT state .addTransition(JobStateInternal.FAIL_ABORT, diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestJobImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestJobImpl.java index ae99ad7308c..6da75a91bbf 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestJobImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestJobImpl.java @@ -195,6 +195,15 @@ public class TestJobImpl { // let the committer complete and verify the job succeeds syncBarrier.await(); assertJobState(job, JobStateInternal.SUCCEEDED); + + job.handle(new JobEvent(job.getID(), + JobEventType.JOB_TASK_ATTEMPT_COMPLETED)); + assertJobState(job, JobStateInternal.SUCCEEDED); + + job.handle(new JobEvent(job.getID(), + JobEventType.JOB_MAP_TASK_RESCHEDULED)); + assertJobState(job, JobStateInternal.SUCCEEDED); + dispatcher.stop(); commitHandler.stop(); }