Github user gczsjdy commented on a diff in the pull request: https://github.com/apache/spark/pull/20039#discussion_r158424211 --- 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 -- Is `synchronized` needed only due to the modification of `queuedEvents`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org