[ https://issues.apache.org/jira/browse/FLINK-4074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344141#comment-15344141 ]
ASF GitHub Bot commented on FLINK-4074: --------------------------------------- Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/2105#discussion_r68036496 --- Diff: flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java --- @@ -170,8 +170,12 @@ public ScopeFormats getScopeFormats() { * @param group the group that contains the metric */ public void register(Metric metric, String metricName, AbstractMetricGroup group) { - if (reporter != null) { - reporter.notifyOfAddedMetric(metric, metricName, group); + try { + if (reporter != null) { + reporter.notifyOfAddedMetric(metric, metricName, group); + } + } catch (Exception e) { + LOG.error("Error while registering metric.", e); --- End diff -- this is simply a fail-safe to ensure that no exceptions are thrown. Generally a reporter shouldn't throw an Exception in these methods, but I'd rather be safe then sorry. > Reporter can block TaskManager shutdown > --------------------------------------- > > Key: FLINK-4074 > URL: https://issues.apache.org/jira/browse/FLINK-4074 > Project: Flink > Issue Type: Improvement > Components: Metrics > Affects Versions: 1.1.0 > Reporter: Chesnay Schepler > Assignee: Chesnay Schepler > Priority: Minor > Fix For: 1.1.0 > > > If a report is being submitted while a TaskManager is shutting down the > reporter can cause the shutdown to be delayed since it submits the complete > report. -- This message was sent by Atlassian JIRA (v6.3.4#6332)