flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [9/9] flink git commit: [hotfix] Add better error reporting in case of wrongly specified retry delay
Date Mon, 15 Feb 2016 15:26:07 GMT
[hotfix] Add better error reporting in case of wrongly specified retry delay


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

Branch: refs/heads/master
Commit: 90532549e7c1e3c461481ae1a7f4ffe33f3860ae
Parents: f60f8fb
Author: Till Rohrmann <trohrmann@apache.org>
Authored: Mon Feb 15 14:36:57 2016 +0100
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Mon Feb 15 16:17:53 2016 +0100

----------------------------------------------------------------------
 .../restart/FixedDelayRestartStrategy.java               | 11 +++++++++--
 .../executiongraph/restart/RestartStrategyFactory.java   | 11 +++++++++--
 .../TaskManagerProcessFailureBatchRecoveryITCase.java    |  2 +-
 3 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/90532549/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
index b5b00e4..03571b8 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
@@ -107,8 +107,15 @@ public class FixedDelayRestartStrategy implements RestartStrategy {
 		try {
 			delay = Duration.apply(delayString).toMillis();
 		} catch (NumberFormatException nfe) {
-			throw new Exception("Invalid config value for " + ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY
+
-				": " + delayString + ". Value must be a valid duration (such as 100 s or 1 min).");
+			if (delayString.equals(timeoutString)) {
+				throw new Exception("Invalid config value for " +
+					ConfigConstants.AKKA_WATCH_HEARTBEAT_PAUSE + ": " + timeoutString +
+					". Value must be a valid duration (such as '10 s' or '1 min')");
+			} else {
+				throw new Exception("Invalid config value for " +
+					ConfigConstants.EXECUTION_RETRY_DELAY_KEY + ": " + delayString +
+					". Value must be a valid duration (such as '100 milli' or '10 s')");
+			}
 		}
 
 		return new FixedDelayRestartStrategy(maxAttempts, delay);

http://git-wip-us.apache.org/repos/asf/flink/blob/90532549/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
index b9da63d..68d114e 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/RestartStrategyFactory.java
@@ -80,8 +80,15 @@ public class RestartStrategyFactory {
 				try {
 					delay = Duration.apply(delayString).toMillis();
 				} catch (NumberFormatException nfe) {
-					throw new Exception("Invalid config value for " + ConfigConstants.EXECUTION_RETRY_DELAY_KEY
+
-						": " + delayString + ". Value must be a valid duration (such as 100 s or 1 min).");
+					if (delayString.equals(pauseString)) {
+						throw new Exception("Invalid config value for " +
+							ConfigConstants.AKKA_WATCH_HEARTBEAT_PAUSE + ": " + pauseString +
+							". Value must be a valid duration (such as '10 s' or '1 min')");
+					} else {
+						throw new Exception("Invalid config value for " +
+							ConfigConstants.EXECUTION_RETRY_DELAY_KEY + ": " + delayString +
+							". Value must be a valid duration (such as '100 milli' or '10 s')");
+					}
 				}
 
 				if (numberExecutionRetries > 0 && delay >= 0) {

http://git-wip-us.apache.org/repos/asf/flink/blob/90532549/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java
index 053722b..2281572 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java
@@ -66,7 +66,7 @@ public class TaskManagerProcessFailureBatchRecoveryITCase extends AbstractTaskMa
 
 		ExecutionEnvironment env = ExecutionEnvironment.createRemoteEnvironment("localhost", jobManagerPort);
 		env.setParallelism(PARALLELISM);
-		env.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, 1000));
+		env.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, 10000));
 		env.getConfig().setExecutionMode(executionMode);
 		env.getConfig().disableSysoutLogging();
 


Mime
View raw message