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

    https://github.com/apache/spark/pull/2002#discussion_r16364099
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -451,10 +451,56 @@ private[spark] object Utils extends Logging {
       /**
        * Get a temporary directory using Spark's spark.local.dir property, if 
set. This will always
        * return a single directory, even though the spark.local.dir property 
might be a list of
    -   * multiple paths.
    +   * multiple paths.  If the SPARK_LOCAL_DIRS environment variable is set, 
then this will return
    +   * a directory from that variable.
        */
       def getLocalDir(conf: SparkConf): String = {
    -    conf.get("spark.local.dir",  
System.getProperty("java.io.tmpdir")).split(',')(0)
    +    getOrCreateLocalRootDirs(conf)(0)
    +  }
    +
    +  /**
    +   * Gets or creates the directories listed in spark.local.dir or 
SPARK_LOCAL_DIRS,
    +   * and returns only the directories that exist / could be created.
    +   */
    +  private[spark] def getOrCreateLocalRootDirs(conf: SparkConf): 
Array[String] = {
    +    val isYarn = java.lang.Boolean.valueOf(
    +      System.getProperty("SPARK_YARN_MODE", 
conf.getenv("SPARK_YARN_MODE")))
    --- End diff --
    
    Sorry actually there is a problem with this in yarn client mode.  In yarn 
client mode the spark driver is on the launcher/gateway box (not in yarn 
cluster) and with these changes the driver tries to look up yarn directories 
even though its not on yarn.  
    
    14/08/18 16:21:59 INFO SparkEnv: Registering BlockManagerMaster
    14/08/18 16:21:59 DEBUG BlockManagerMasterActor: [actor] received message 
ExpireDeadHosts from Actor[akka://spark/user/BlockManagerMaster#-836784892]
    14/08/18 16:21:59 DEBUG BlockManagerMasterActor: [actor] handled message 
(2.386093 ms) ExpireDeadHosts from 
Actor[akka://spark/user/BlockManagerMaster#-836784892]
    Exception in thread "main" java.lang.Exception: Yarn Local dirs can't be 
empty
            at org.apache.spark.util.Utils$.getYarnLocalDirs(Utils.scala:501)
            at 
org.apache.spark.util.Utils$.getOrCreateLocalRootDirs(Utils.scala:471)
            at 
org.apache.spark.storage.DiskBlockManager.createLocalDirs(DiskBlockManager.scala:137)


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