flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [33/63] [abbrv] git commit: Better error messages at TaskManager startup and registration
Date Sun, 21 Sep 2014 02:12:57 GMT
Better error messages at TaskManager startup and registration


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

Branch: refs/heads/master
Commit: 8998a30ea036e6770c9a6b6442ffe01e64720c66
Parents: d5d3a08
Author: Stephan Ewen <sewen@apache.org>
Authored: Mon Sep 15 16:51:12 2014 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Sat Sep 20 20:02:49 2014 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/taskmanager/TaskManager.java    | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/8998a30e/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManager.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManager.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManager.java
index 1fd5a71..d6494a7 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManager.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManager.java
@@ -51,7 +51,6 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-
 import org.apache.flink.api.common.cache.DistributedCache;
 import org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry;
 import org.apache.flink.configuration.ConfigConstants;
@@ -97,7 +96,6 @@ import org.apache.flink.runtime.util.EnvironmentInformation;
 import org.apache.flink.runtime.util.ExecutorThreadFactory;
 import org.apache.flink.util.ExceptionUtils;
 import org.apache.flink.util.StringUtils;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -763,8 +761,12 @@ public class TaskManager implements TaskOperationProtocol {
 					try {
 						resultId = this.jobManager.registerTaskManager(this.localInstanceConnectionInfo,
 								this.hardwareDescription, this.numberOfSlots);
+						
+						if (resultId == null) {
+							throw new Exception("Registration attempt refused by JobManager.");
+						}
 					}
-					catch (IOException e) {
+					catch (Exception e) {
 						// this may be if the job manager was not yet online
 						// if this has happened for a while, report it. if it has just happened
 						// at the very beginning, this may not mean anything (JM still in startup)
@@ -780,9 +782,6 @@ public class TaskManager implements TaskOperationProtocol {
 						// success
 						this.registeredId = resultId;
 						break;
-					} else {
-						// this is bad. The job manager refused us. report and try again later
-						LOG.error("Registration attempt refused by JobManager.");
 					}
 		
 					try {


Mime
View raw message