spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-2645] [Core] Allow SparkEnv.stop() to b...
Date Tue, 30 Jun 2015 17:44:14 GMT
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6973#discussion_r33601514
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkEnv.scala ---
    @@ -90,39 +92,44 @@ class SparkEnv (
       private var driverTmpDirToDelete: Option[String] = None
     
       private[spark] def stop() {
    -    isStopped = true
    -    pythonWorkers.foreach { case(key, worker) => worker.stop() }
    -    Option(httpFileServer).foreach(_.stop())
    -    mapOutputTracker.stop()
    -    shuffleManager.stop()
    -    broadcastManager.stop()
    -    blockManager.stop()
    -    blockManager.master.stop()
    -    metricsSystem.stop()
    -    outputCommitCoordinator.stop()
    -    rpcEnv.shutdown()
    -
    -    // Unfortunately Akka's awaitTermination doesn't actually wait for the Netty server
to shut
    -    // down, but let's call it anyway in case it gets fixed in a later release
    -    // UPDATE: In Akka 2.1.x, this hangs if there are remote actors, so we can't call
it.
    -    // actorSystem.awaitTermination()
    -
    -    // Note that blockTransferService is stopped by BlockManager since it is started
by it.
    -
    -    // If we only stop sc, but the driver process still run as a services then we need
to delete
    -    // the tmp dir, if not, it will create too many tmp dirs.
    -    // We only need to delete the tmp dir create by driver, because sparkFilesDir is
point to the
    -    // current working dir in executor which we do not need to delete.
    -    driverTmpDirToDelete match {
    -      case Some(path) => {
    -        try {
    -          Utils.deleteRecursively(new File(path))
    -        } catch {
    -          case e: Exception =>
    -            logWarning(s"Exception while deleting Spark temp dir: $path", e)
    +
    +    if (!isStopped) {
    +      isStopped = true
    +
    +      pythonWorkers.foreach { case (key, worker) => worker.stop()}
    +      Option(httpFileServer).foreach(_.stop())
    +      mapOutputTracker.stop()
    +      shuffleManager.stop()
    +      broadcastManager.stop()
    +      blockManager.stop()
    +      blockManager.master.stop()
    +      metricsSystem.stop()
    +      outputCommitCoordinator.stop()
    +      rpcEnv.shutdown()
    +
    +
    --- End diff --
    
    can you kill this blank line


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message