flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [1/2] flink git commit: [FLINK-6184] Prevent NPE in buffer metrics
Date Tue, 04 Apr 2017 11:36:12 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.2 a359b4cfa -> 3c63c9e01


[FLINK-6184] Prevent NPE in buffer metrics


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/961134d4
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/961134d4
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/961134d4

Branch: refs/heads/release-1.2
Commit: 961134d4e988edc01705501a8530aa5a120080cd
Parents: a359b4c
Author: zentol <chesnay@apache.org>
Authored: Fri Mar 24 19:11:58 2017 +0100
Committer: zentol <chesnay@apache.org>
Committed: Tue Apr 4 12:07:38 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/runtime/taskmanager/Task.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/961134d4/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
index d242d7a..53d07f6 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
@@ -380,11 +380,6 @@ public class Task implements Runnable, TaskActions {
 
 		// finally, create the executing thread, but do not start it
 		executingThread = new Thread(TASK_THREADS_GROUP, this, taskNameWithSubtask);
-
-		if (this.metrics != null && this.metrics.getIOMetricGroup() != null) {
-			// add metrics for buffers
-			this.metrics.getIOMetricGroup().initializeBufferMetrics(this);
-		}
 	}
 
 	// ------------------------------------------------------------------------
@@ -577,6 +572,11 @@ public class Task implements Runnable, TaskActions {
 
 			network.registerTask(this);
 
+			if (this.metrics != null && this.metrics.getIOMetricGroup() != null) {
+				// add metrics for buffers
+				this.metrics.getIOMetricGroup().initializeBufferMetrics(this);
+			}
+
 			// next, kick off the background copying of files for the distributed cache
 			try {
 				for (Map.Entry<String, DistributedCache.DistributedCacheEntry> entry :


Mime
View raw message