Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2001#discussion_r16906649
  
    --- Diff: 
yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientClusterScheduler.scala
 ---
    @@ -36,4 +36,18 @@ private[spark] class YarnClientClusterScheduler(sc: 
SparkContext, conf: Configur
         val host = Utils.parseHostPort(hostPort)._1
         Option(YarnSparkHadoopUtil.lookupRack(conf, host))
       }
    +
    +  override def postStartHook() {
    +    Runtime.getRuntime.addShutdownHook(new Thread with Logging {
    --- End diff --
    
    Also, it's a better idea to use Hadoop's `ShutdownHookManager`. That allows 
you to make sure this runs before the HDFS shutdown hook, and avoid ugly 
exceptions (like "file system closed") showing up. See ApplicationMaster.scala, 
for example.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to