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. Is this a requirement? (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:
us...@infra.apache.org



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

Reply via email to