Browse Source

YARN-150. AppRejectedTransition does not unregister app from master service and scheduler (Bikas Shah via tgraves)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1443143 13f79535-47bb-0310-9956-ffa450edef68
Thomas Graves 12 năm trước cách đây
mục cha
commit
793b543f96

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -35,6 +35,9 @@ Release 0.23.7 - UNRELEASED
     YARN-355. Fixes a bug where RM app submission could jam under load.
     (Daryn Sharp via sseth)
 
+    YARN-150. AppRejectedTransition does not unregister app from master service
+    and scheduler (Bikas Shah via tgraves)
+
 Release 0.23.6 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 4 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java

@@ -572,6 +572,10 @@ public class RMAppAttemptImpl implements RMAppAttempt {
 
       RMAppAttemptRejectedEvent rejectedEvent = (RMAppAttemptRejectedEvent) event;
 
+      // Tell the AMS. Unregister from the ApplicationMasterService
+      appAttempt.masterService
+          .unregisterAttempt(appAttempt.applicationAttemptId);
+      
       // Save the diagnostic message
       String message = rejectedEvent.getMessage();
       appAttempt.setDiagnostics(message);

+ 3 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/TestRMAppAttemptTransitions.java

@@ -264,6 +264,9 @@ public class TestRMAppAttemptTransitions {
     assertNull(applicationAttempt.getFinalApplicationStatus());
     
     // Check events
+    verify(masterService).
+        unregisterAttempt(applicationAttempt.getAppAttemptId());
+    
     verify(application).handle(any(RMAppRejectedEvent.class));
   }
 
@@ -443,7 +446,6 @@ public class TestRMAppAttemptTransitions {
     testAppAttemptRunningState(container, host, rpcPort, trackingUrl);
   }
     
-
   @Test
   public void testNewToKilled() {
     applicationAttempt.handle(