YARN-933. Fixed InvalidStateTransitonException at FINAL_SAVING state in RMApp. Contributed by Rohith Sharmaks
(cherry picked from commit c0d9b93953
)
This commit is contained in:
parent
da52fdb999
commit
eaeaf80d39
|
@ -587,6 +587,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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue