You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/09/01 20:08:36 UTC

[GitHub] [hadoop] goiri commented on a diff in pull request #4836: YARN-11289. [Federation] Improve NM FederationInterceptor removeAppFromRegistry.

goiri commented on code in PR #4836:
URL: https://github.com/apache/hadoop/pull/4836#discussion_r961057993


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java:
##########
@@ -770,18 +771,26 @@ public FinishApplicationMasterResponse finishApplicationMaster(
 
     if (failedToUnRegister) {
       homeResponse.setIsUnregistered(false);
-    } else {
+    } else if (checkRequestFinalApplicationStatusSuccess(request)) {
       // Clean up UAMs only when the app finishes successfully, so that no more
       // attempt will be launched.
       this.uamPool.stop();
-      if (this.registryClient != null) {
-        this.registryClient
-            .removeAppFromRegistry(this.attemptId.getApplicationId());
-      }
+      removeAppFromRegistry();
     }
     return homeResponse;
   }
 
+  private boolean checkRequestFinalApplicationStatusSuccess(FinishApplicationMasterRequest request) {
+    if (request == null) {
+      return false;
+    } else if(request.getFinalApplicationStatus() == null){

Review Comment:
   If you do the return, no need for the else.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org