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

    https://github.com/apache/spark/pull/9116#discussion_r42010758
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
    @@ -694,31 +694,39 @@ class StreamingContext private[streaming] (
        * @param stopGracefully if true, stops gracefully by waiting for the 
processing of all
        *                       received data to be completed
        */
    -  def stop(stopSparkContext: Boolean, stopGracefully: Boolean): Unit = 
synchronized {
    -    try {
    -      state match {
    -        case INITIALIZED =>
    -          logWarning("StreamingContext has not been started yet")
    -        case STOPPED =>
    -          logWarning("StreamingContext has already been stopped")
    -        case ACTIVE =>
    -          scheduler.stop(stopGracefully)
    -          // Removing the streamingSource to de-register the metrics on 
stop()
    -          env.metricsSystem.removeSource(streamingSource)
    -          uiTab.foreach(_.detach())
    -          StreamingContext.setActiveContext(null)
    -          waiter.notifyStop()
    -          if (shutdownHookRef != null) {
    -            ShutdownHookManager.removeShutdownHook(shutdownHookRef)
    -          }
    -          logInfo("StreamingContext stopped successfully")
    +  def stop(stopSparkContext: Boolean, stopGracefully: Boolean): Unit = {
    +    var shutdownHookRefToRemove: AnyRef = null
    --- End diff --
    
    Yes I get that; was mostly wondering whether a second variable was needed 
at all. I think it is, to fully preserve the way it works now. This seems OK.


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

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

Reply via email to