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

    https://github.com/apache/spark/pull/22192#discussion_r215749405
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/Executor.scala ---
    @@ -136,6 +136,32 @@ private[spark] class Executor(
       // for fetching remote cached RDD blocks, so need to make sure it uses 
the right classloader too.
       env.serializerManager.setDefaultClassLoader(replClassLoader)
     
    +  private val pluginList = conf.get(EXECUTOR_PLUGINS)
    +  if (pluginList.nonEmpty) {
    +    logDebug(s"Initializing the following plugins: 
${pluginList.mkString(", ")}")
    +  }
    +
    +  val executorPluginThread = new Thread {
    +    var plugins: Seq[ExecutorPlugin] = Nil
    +
    +    override def run(): Unit = {
    +      plugins = Utils.loadExtensions(classOf[ExecutorPlugin], pluginList, 
conf)
    +      plugins.foreach(_.init())
    +    }
    +
    +    override def interrupt(): Unit = {
    +      plugins.foreach(_.shutdown())
    +      super.interrupt()
    --- End diff --
    
    super.interrupt in try/finally.
    Also would be good to isolate the shutdown of each plugin from others (so 
that an exception thrown in one plugin does not prevent another plugin from 
shutting down)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to