spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanzin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-3090] [core] Stop SparkContext if user ...
Date Sat, 25 Apr 2015 00:16:57 GMT
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5696#discussion_r29095193
  
    --- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala ---
    @@ -95,14 +95,8 @@ private[spark] class ApplicationMaster(
     
           val fs = FileSystem.get(yarnConf)
     
    -      Utils.addShutdownHook { () =>
    -        // If the SparkContext is still registered, shut it down as a best case effort
in case
    -        // users do not call sc.stop or do System.exit().
    -        val sc = sparkContextRef.get()
    -        if (sc != null) {
    -          logInfo("Invoking sc stop from shutdown hook")
    -          sc.stop()
    -        }
    +      // This shutdown hook should run *after* the SparkContext is shut down.
    +      Utils.addShutdownHook(Utils.SPARK_CONTEXT_SHUTDOWN_PRIORITY - 1) { () =>
    --- End diff --
    
    > Calling stop() is idempotent right?
    
    Correct.
    
    > You have some spurious white-space changes in this PR.
    
    IIRC that's in the style guide (not adding trailing whitespace) and we're really, really
bad at enforcing that.


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