BOOTMGR opened a new pull request #34039: URL: https://github.com/apache/spark/pull/34039
### What changes were proposed in this pull request? When `SparkContext` is shutting down, wait for listener bus to finish and then only flush `MetricsSystem`. ### Why are the changes needed? In current implementation, when `SparkContext.stop()` is called, `metricsSystem.report()` is called before `listenerBus.stop()`. In this case, if some listener is producing some metrics, they would never reach sink. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? NA -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org