xinglin commented on code in PR #38832:
URL: https://github.com/apache/spark/pull/38832#discussion_r1038620628
##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala:
##########
@@ -240,6 +240,9 @@ private[spark] class ApplicationMaster(
logInfo("ApplicationAttemptId: " + appAttemptId)
+ // During shutdown, we may not be able to create an FileSystem object.
So, pre-create here.
+ val stagingDirPath = new Path(System.getenv("SPARK_YARN_STAGING_DIR"))
+ val stagingDirFs = stagingDirPath.getFileSystem(yarnConf)
Review Comment:
the shutdownhook has a reference to the filesystem object, and Java won't
GC/free an object until there is no more reference to it, right?
In ShutdownHookManager.java, it adds all hooks into a Set (`hooks`). But in
`executeShutdown()` to execute each hook, it does not remove each reference
from the Set. So, the references should still be stored in `hooks`. To remove
the reference, I think we should either add `hooks.clear()` at the end of
`executeShutdown()` or remove the hook from Spark.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]