PawasChhokra commented on a change in pull request #1422:
URL: https://github.com/apache/samza/pull/1422#discussion_r480596684



##########
File path: 
samza-yarn/src/main/scala/org/apache/samza/job/yarn/SamzaYarnAppMasterLifecycle.scala
##########
@@ -68,8 +71,17 @@ class SamzaYarnAppMasterLifecycle(containerMem: Int, 
containerCpu: Int, samzaApp
     //allowing the RM to restart it (potentially on a different host)
     if(samzaAppStatus != SamzaAppStatus.UNDEFINED) {
       info("Unregistering AM from the RM.")
-      amClient.unregisterApplicationMaster(yarnStatus, shutdownMessage, null)
-      info("Unregister complete.")
+      try {
+        amClient.unregisterApplicationMaster(yarnStatus, shutdownMessage, null)
+        info("Unregister complete.")
+      } catch {
+        case ex: InvalidApplicationMasterRequestException =>
+          // Once the AM dies, the corresponding app attempt ID is removed 
from the RM cache so that the RM can spin up a new AM and its containers.

Review comment:
       Fixed the log. Also validated with `yarn.nodemanager.recovery.enabled` 
set to `true`. It works as expected.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to