YARN-933. Fixed InvalidStateTransitonException at FINAL_SAVING state in RMApp. Contributed by Rohith Sharmaks

This commit is contained in:
Jian He 2015-02-19 15:42:39 -08:00
parent d49ae725d5
commit c0d9b93953
3 changed files with 35 additions and 0 deletions

View File

@ -623,6 +623,9 @@ Release 2.7.0 - UNRELEASED
YARN-1615. Fix typos in description about delay scheduling. (Akira Ajisaka via
ozawa)
YARN-933. Fixed InvalidStateTransitonException at FINAL_SAVING state in
RMApp. (Rohith Sharmaks via jianhe)
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES

View File

@ -354,6 +354,8 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
EnumSet.of(
RMAppAttemptEventType.UNREGISTERED,
RMAppAttemptEventType.STATUS_UPDATE,
RMAppAttemptEventType.LAUNCHED,
RMAppAttemptEventType.LAUNCH_FAILED,
// should be fixed to reject container allocate request at Final
// Saving in scheduler
RMAppAttemptEventType.CONTAINER_ALLOCATED,

View File

@ -919,6 +919,36 @@ public class TestRMAppAttemptTransitions {
testAppAttemptFailedState(amContainer, diagnostics);
}
@Test(timeout = 10000)
public void testLaunchedAtFinalSaving() {
Container amContainer = allocateApplicationAttempt();
// ALLOCATED->FINAL_SAVING
applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
.getAppAttemptId(), RMAppAttemptEventType.KILL));
assertEquals(RMAppAttemptState.FINAL_SAVING,
applicationAttempt.getAppAttemptState());
// verify for both launched and launch_failed transitions in final_saving
applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
.getAppAttemptId(), RMAppAttemptEventType.LAUNCHED));
applicationAttempt.handle(new RMAppAttemptLaunchFailedEvent(
applicationAttempt.getAppAttemptId(), "Launch Failed"));
assertEquals(RMAppAttemptState.FINAL_SAVING,
applicationAttempt.getAppAttemptState());
testAppAttemptKilledState(amContainer, EMPTY_DIAGNOSTICS);
// verify for both launched and launch_failed transitions in killed
applicationAttempt.handle(new RMAppAttemptEvent(applicationAttempt
.getAppAttemptId(), RMAppAttemptEventType.LAUNCHED));
applicationAttempt.handle(new RMAppAttemptLaunchFailedEvent(
applicationAttempt.getAppAttemptId(), "Launch Failed"));
assertEquals(RMAppAttemptState.KILLED,
applicationAttempt.getAppAttemptState());
}
@Test
public void testAMCrashAtAllocated() {
Container amContainer = allocateApplicationAttempt();