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

    https://github.com/apache/spark/pull/20039#discussion_r159080455
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala ---
    @@ -149,7 +158,11 @@ private[spark] class LiveListenerBus(conf: SparkConf) {
         }
     
         this.sparkContext = sc
    -    queues.asScala.foreach(_.start(sc))
    +    queues.asScala.foreach { q =>
    +      q.start(sc)
    +      queuedEvents.foreach(q.post)
    --- End diff --
    
    sure, but the interleaving you were worried about specifically above isn't 
possible because of the synchronized blocks.
    
    Yes, you could get one line into `start()`, switch to `stop()` and get a 
few lines in ... but then `stop()` gets blocked on `start()` anyway.  Sure, 
that means that while `start()` is running, we also have `stopped == true` ... 
but so what?  More `post()` calls will be no-ops.  `start()` will start the 
queues and post all buffered events, then release the lock and `stop()` will 
stop all the queues.


---

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

Reply via email to