Github user gczsjdy commented on a diff in the pull request: https://github.com/apache/spark/pull/20039#discussion_r158309818 --- Diff: core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala --- @@ -124,13 +127,19 @@ private[spark] class LiveListenerBus(conf: SparkConf) { } /** Post an event to all queues. */ - def post(event: SparkListenerEvent): Unit = { - if (!stopped.get()) { - metrics.numEventsPosted.inc() + def post(event: SparkListenerEvent): Unit = synchronized { + if (stopped.get()) { + return + } --- End diff -- What's the difference between this and the original way ``` if (!stopped.get()) { ... } ``` ?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org