You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/05/02 20:43:22 UTC

[GitHub] [spark] imback82 commented on a change in pull request #28435: [SPARK-31625][YARN] Unregister application from YARN RM outside the shutdown hook if it succeeds

imback82 commented on a change in pull request #28435:
URL: https://github.com/apache/spark/pull/28435#discussion_r419005627



##########
File path: resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
##########
@@ -727,6 +729,10 @@ private[spark] class ApplicationMaster(
             mainMethod.invoke(null, userArgs.toArray)
             finish(FinalApplicationStatus.SUCCEEDED, ApplicationMaster.EXIT_SUCCESS)
             logDebug("Done running user class")
+            if (!unregistered) {
+              unregister(finalStatus, finalMsg)
+              cleanupStagingDir(defaultStagingDir)
+            }

Review comment:
       One question I have is the following comment:
   https://github.com/apache/spark/blob/13dddee9a8490ead00ff00bd741db4a170dfd759/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala#L236-L238
   
   This hook is responsible calling `unregister`. So, if the user code didn't explicitly stop the `SparkContext`, this change calls `unregister` before `SparkContext` is stopped. Will this be OK? (from my testing, I didn't find anything wrong so far, but I could be missing something.)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org