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

    https://github.com/apache/spark/pull/1132#discussion_r13984220
  
    --- 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 --
    
    It requires changing `Executor`'s constructor and hence other backends like 
mesos. This is not a new issue introduced in this PR. I removed props from 
`RegisteredExecutor` message.


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