MAPREDUCE-6826. Job fails with InvalidStateTransitonException: Invalid event: JOB_TASK_COMPLETED at SUCCEEDED/COMMITTING. Contributed by Bilwa S T.
(cherry picked from commit d4e36409d4
)
This commit is contained in:
parent
ae2d856515
commit
c70f5eb8fa
|
@ -422,7 +422,8 @@ public class JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job,
|
||||||
EnumSet.of(JobEventType.JOB_UPDATED_NODES,
|
EnumSet.of(JobEventType.JOB_UPDATED_NODES,
|
||||||
JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE,
|
JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE,
|
||||||
JobEventType.JOB_TASK_ATTEMPT_COMPLETED,
|
JobEventType.JOB_TASK_ATTEMPT_COMPLETED,
|
||||||
JobEventType.JOB_MAP_TASK_RESCHEDULED))
|
JobEventType.JOB_MAP_TASK_RESCHEDULED,
|
||||||
|
JobEventType.JOB_TASK_COMPLETED))
|
||||||
|
|
||||||
// Transitions from SUCCEEDED state
|
// Transitions from SUCCEEDED state
|
||||||
.addTransition(JobStateInternal.SUCCEEDED, JobStateInternal.SUCCEEDED,
|
.addTransition(JobStateInternal.SUCCEEDED, JobStateInternal.SUCCEEDED,
|
||||||
|
@ -441,7 +442,8 @@ public class JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job,
|
||||||
JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE,
|
JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE,
|
||||||
JobEventType.JOB_AM_REBOOT,
|
JobEventType.JOB_AM_REBOOT,
|
||||||
JobEventType.JOB_TASK_ATTEMPT_COMPLETED,
|
JobEventType.JOB_TASK_ATTEMPT_COMPLETED,
|
||||||
JobEventType.JOB_MAP_TASK_RESCHEDULED))
|
JobEventType.JOB_MAP_TASK_RESCHEDULED,
|
||||||
|
JobEventType.JOB_TASK_COMPLETED))
|
||||||
|
|
||||||
// Transitions from FAIL_WAIT state
|
// Transitions from FAIL_WAIT state
|
||||||
.addTransition(JobStateInternal.FAIL_WAIT,
|
.addTransition(JobStateInternal.FAIL_WAIT,
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class TestJobImpl {
|
||||||
public void testCheckJobCompleteSuccess() throws Exception {
|
public void testCheckJobCompleteSuccess() throws Exception {
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
|
conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
|
||||||
AsyncDispatcher dispatcher = new AsyncDispatcher();
|
DrainDispatcher dispatcher = new DrainDispatcher();
|
||||||
dispatcher.init(conf);
|
dispatcher.init(conf);
|
||||||
dispatcher.start();
|
dispatcher.start();
|
||||||
CyclicBarrier syncBarrier = new CyclicBarrier(2);
|
CyclicBarrier syncBarrier = new CyclicBarrier(2);
|
||||||
|
@ -226,6 +226,11 @@ public class TestJobImpl {
|
||||||
JobEventType.JOB_MAP_TASK_RESCHEDULED));
|
JobEventType.JOB_MAP_TASK_RESCHEDULED));
|
||||||
assertJobState(job, JobStateInternal.COMMITTING);
|
assertJobState(job, JobStateInternal.COMMITTING);
|
||||||
|
|
||||||
|
job.handle(new JobEvent(job.getID(),
|
||||||
|
JobEventType.JOB_TASK_COMPLETED));
|
||||||
|
dispatcher.await();
|
||||||
|
assertJobState(job, JobStateInternal.COMMITTING);
|
||||||
|
|
||||||
// let the committer complete and verify the job succeeds
|
// let the committer complete and verify the job succeeds
|
||||||
syncBarrier.await();
|
syncBarrier.await();
|
||||||
assertJobState(job, JobStateInternal.SUCCEEDED);
|
assertJobState(job, JobStateInternal.SUCCEEDED);
|
||||||
|
@ -238,6 +243,11 @@ public class TestJobImpl {
|
||||||
JobEventType.JOB_MAP_TASK_RESCHEDULED));
|
JobEventType.JOB_MAP_TASK_RESCHEDULED));
|
||||||
assertJobState(job, JobStateInternal.SUCCEEDED);
|
assertJobState(job, JobStateInternal.SUCCEEDED);
|
||||||
|
|
||||||
|
job.handle(new JobEvent(job.getID(),
|
||||||
|
JobEventType.JOB_TASK_COMPLETED));
|
||||||
|
dispatcher.await();
|
||||||
|
assertJobState(job, JobStateInternal.SUCCEEDED);
|
||||||
|
|
||||||
dispatcher.stop();
|
dispatcher.stop();
|
||||||
commitHandler.stop();
|
commitHandler.stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue