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

    https://github.com/apache/spark/pull/1132#discussion_r13980397
  
    --- Diff: 
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
 ---
    @@ -101,26 +106,33 @@ private[spark] object CoarseGrainedExecutorBackend {
         workerUrl: Option[String]) {
     
         SparkHadoopUtil.get.runAsSparkUser { () =>
    -        // Debug code
    -        Utils.checkHost(hostname)
    -
    -        val conf = new SparkConf
    -        // Create a new ActorSystem to run the backend, because we can't 
create a
    -        // SparkEnv / Executor before getting started with all our system 
properties, etc
    -        val (actorSystem, boundPort) = 
AkkaUtils.createActorSystem("sparkExecutor", hostname, 0,
    -          conf, new SecurityManager(conf))
    -        // set it
    -        val sparkHostPort = hostname + ":" + boundPort
    -        actorSystem.actorOf(
    -          Props(classOf[CoarseGrainedExecutorBackend], driverUrl, 
executorId,
    -            sparkHostPort, cores),
    -          name = "Executor")
    -        workerUrl.foreach {
    -          url =>
    -            actorSystem.actorOf(Props(classOf[WorkerWatcher], url), name = 
"WorkerWatcher")
    -        }
    -        actorSystem.awaitTermination()
    -
    +      // Debug code
    +      Utils.checkHost(hostname)
    +
    +      // Bootstrap to fetch the driver's Spark properties.
    +      val executorConf = new SparkConf
    +      val (fetcher, _) = AkkaUtils.createActorSystem(
    +        "driverPropsFetcher", hostname, 0, executorConf, new 
SecurityManager(executorConf))
    +      val driver = fetcher.actorSelection(driverUrl)
    +      val timeout = new Timeout(5, TimeUnit.MINUTES)
    +      val fut = Patterns.ask(driver, RetrieveSparkProps, timeout)
    +      val props = Await.result(fut, 
timeout.duration).asInstanceOf[Seq[(String, String)]]
    +      fetcher.shutdown()
    +
    +      // Create a new ActorSystem to run the backend, because we can't 
create a
    --- End diff --
    
    This comment is no longer technically true -- I think we do have all the 
information to start a proper SparkEnv, whose actor system we could use 
instead. Also, RegisteredExecutor() no longer needs t otake these properties.


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

Reply via email to