srowen commented on a change in pull request #26427: [SPARK-29795][CORE]
Explicitly clear registered metrics on MetricSystem shutdown
URL: https://github.com/apache/spark/pull/26427#discussion_r343777361
##########
File path: core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala
##########
@@ -110,6 +110,7 @@ private[spark] class MetricsSystem private (
def stop(): Unit = {
if (running) {
sinks.foreach(_.stop)
+ registry.removeMatching((_: String, _: Metric) => true)
Review comment:
Note that in Spark 2.4, this had to be:
```
registry.removeMatching(new MetricFilter {
override def matches(name: String, metric: Metric): Boolean = true
})
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]