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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to