flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request #3610: [FLINK-6183]/[FLINK-6184] Prevent some NPE and unc...
Date Tue, 28 Mar 2017 17:07:05 GMT
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3610#discussion_r108478998
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskManagerJobMetricGroup.java
---
    @@ -80,8 +80,17 @@ public TaskMetricGroup addTask(
     					taskName,
     					subtaskIndex,
     					attemptNumber);
    -				tasks.put(executionAttemptID, task);
    -				return task;
    +				TaskMetricGroup prior = tasks.put(executionAttemptID, task);
    +				if (prior == null) {
    +					return task;
    --- End diff --
    
    Can you avoid adding `closeLocally()` by simply doing a "contains()" check before creating
the group?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message