YARN-4411. RMAppAttemptImpl#createApplicationAttemptReport throws
IllegalArgumentException. Contributed by Bibin A Chundatt and yarntime.
This commit is contained in:
parent
df99ea8a92
commit
a277bdc9ed
|
@ -392,6 +392,9 @@ Release 2.8.0 - UNRELEASED
|
||||||
|
|
||||||
YARN-4219. New levelDB cache storage for timeline v1.5. (Li Lu via xgong)
|
YARN-4219. New levelDB cache storage for timeline v1.5. (Li Lu via xgong)
|
||||||
|
|
||||||
|
YARN-4411. RMAppAttemptImpl#createApplicationAttemptReport throws
|
||||||
|
IllegalArgumentException. (Bibin A Chundatt, yarntime via devaraj)
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
|
||||||
YARN-644. Basic null check is not performed on passed in arguments before
|
YARN-644. Basic null check is not performed on passed in arguments before
|
||||||
|
|
|
@ -2067,11 +2067,11 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
|
||||||
// am container.
|
// am container.
|
||||||
ContainerId amId =
|
ContainerId amId =
|
||||||
masterContainer == null ? null : masterContainer.getId();
|
masterContainer == null ? null : masterContainer.getId();
|
||||||
attemptReport = ApplicationAttemptReport.newInstance(this
|
attemptReport = ApplicationAttemptReport.newInstance(
|
||||||
.getAppAttemptId(), this.getHost(), this.getRpcPort(), this
|
this.getAppAttemptId(), this.getHost(), this.getRpcPort(),
|
||||||
.getTrackingUrl(), this.getOriginalTrackingUrl(), this.getDiagnostics(),
|
this.getTrackingUrl(), this.getOriginalTrackingUrl(),
|
||||||
YarnApplicationAttemptState.valueOf(this.getState().toString()),
|
this.getDiagnostics(), createApplicationAttemptState(), amId,
|
||||||
amId, this.startTime, this.finishTime);
|
this.startTime, this.finishTime);
|
||||||
} finally {
|
} finally {
|
||||||
this.readLock.unlock();
|
this.readLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -917,6 +917,19 @@ public class TestRMAppAttemptTransitions {
|
||||||
testAppAttemptFailedState(amContainer, diagnostics);
|
testAppAttemptFailedState(amContainer, diagnostics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(timeout = 10000)
|
||||||
|
public void testCreateAppAttemptReport() {
|
||||||
|
RMAppAttemptState[] attemptStates = RMAppAttemptState.values();
|
||||||
|
applicationAttempt.handle(new RMAppAttemptEvent(
|
||||||
|
applicationAttempt.getAppAttemptId(), RMAppAttemptEventType.KILL));
|
||||||
|
// ALL RMAppAttemptState TO BE CHECK
|
||||||
|
RMAppAttempt attempt = spy(applicationAttempt);
|
||||||
|
for (RMAppAttemptState rmAppAttemptState : attemptStates) {
|
||||||
|
when(attempt.getState()).thenReturn(rmAppAttemptState);
|
||||||
|
attempt.createApplicationAttemptReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test(timeout = 10000)
|
@Test(timeout = 10000)
|
||||||
public void testLaunchedAtFinalSaving() {
|
public void testLaunchedAtFinalSaving() {
|
||||||
Container amContainer = allocateApplicationAttempt();
|
Container amContainer = allocateApplicationAttempt();
|
||||||
|
|
Loading…
Reference in New Issue