YARN-9565. RMAppImpl#ranNodes not cleared on FinalTransition. Contributed by Bilwa S T.

This commit is contained in:
bibinchundatt 2019-06-11 23:10:41 +05:30
parent f918e3fe62
commit 60c95e9b6a
2 changed files with 6 additions and 0 deletions

View File

@ -1522,6 +1522,7 @@ public class RMAppImpl implements RMApp, Recoverable {
app.handler.handle( app.handler.handle(
new RMNodeCleanAppEvent(nodeId, app.applicationId)); new RMNodeCleanAppEvent(nodeId, app.applicationId));
} }
app.ranNodes.clear();
// Recovered apps that are completed were not added to scheduler, so no // Recovered apps that are completed were not added to scheduler, so no
// need to remove them from scheduler. // need to remove them from scheduler.
if (app.recoveredFinalState == null) { if (app.recoveredFinalState == null) {

View File

@ -45,6 +45,7 @@ import org.apache.hadoop.yarn.api.records.LocalResource;
import org.apache.hadoop.yarn.api.records.LocalResourceType; import org.apache.hadoop.yarn.api.records.LocalResourceType;
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility; import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
import org.apache.hadoop.yarn.api.records.LogAggregationContext; import org.apache.hadoop.yarn.api.records.LogAggregationContext;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.Priority; import org.apache.hadoop.yarn.api.records.Priority;
import org.apache.hadoop.yarn.api.records.ResourceRequest; import org.apache.hadoop.yarn.api.records.ResourceRequest;
import org.apache.hadoop.yarn.api.records.URL; import org.apache.hadoop.yarn.api.records.URL;
@ -569,6 +570,7 @@ public class TestRMAppTransitions {
protected RMApp testCreateAppAccepted( protected RMApp testCreateAppAccepted(
ApplicationSubmissionContext submissionContext) throws IOException { ApplicationSubmissionContext submissionContext) throws IOException {
RMApp application = testCreateAppSubmittedNoRecovery(submissionContext); RMApp application = testCreateAppSubmittedNoRecovery(submissionContext);
NodeId nodeId = NodeId.newInstance("host", 1234);
// SUBMITTED => ACCEPTED event RMAppEventType.APP_ACCEPTED // SUBMITTED => ACCEPTED event RMAppEventType.APP_ACCEPTED
RMAppEvent event = RMAppEvent event =
new RMAppEvent(application.getApplicationId(), new RMAppEvent(application.getApplicationId(),
@ -576,6 +578,8 @@ public class TestRMAppTransitions {
application.handle(event); application.handle(event);
assertStartTimeSet(application); assertStartTimeSet(application);
assertAppState(RMAppState.ACCEPTED, application); assertAppState(RMAppState.ACCEPTED, application);
application.handle(
new RMAppRunningOnNodeEvent(application.getApplicationId(), nodeId));
return application; return application;
} }
@ -1089,6 +1093,7 @@ public class TestRMAppTransitions {
rmDispatcher.await(); rmDispatcher.await();
assertTimesAtFinish(application); assertTimesAtFinish(application);
assertAppState(RMAppState.FINISHED, application); assertAppState(RMAppState.FINISHED, application);
Assert.assertEquals(0, application.getRanNodes().size());
StringBuilder diag = application.getDiagnostics(); StringBuilder diag = application.getDiagnostics();
Assert.assertEquals("application diagnostics is not correct", Assert.assertEquals("application diagnostics is not correct",
"", diag.toString()); "", diag.toString());