tillrohrmann commented on a change in pull request #10056: [FLINK-14565][metric] Shut down SystemResourcesCounter on Metric closed to prevent thread leak URL: https://github.com/apache/flink/pull/10056#discussion_r341628869
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/ProcessMetricGroup.java ########## @@ -18,18 +18,40 @@ package org.apache.flink.runtime.metrics.groups; +import org.apache.flink.api.common.time.Time; import org.apache.flink.runtime.metrics.MetricRegistry; +import org.apache.flink.runtime.metrics.util.SystemResourcesCounter; /** * {@link AbstractImitatingJobManagerMetricGroup} implementation for process related metrics. */ public class ProcessMetricGroup extends AbstractImitatingJobManagerMetricGroup { + private volatile SystemResourcesCounter systemResourcesCounter; Review comment: I think this is not the right place. I would rather keep this part out of the `MetricGroup`. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services