You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mb...@apache.org on 2015/01/12 11:25:07 UTC

[3/5] flink git commit: [FLINK-1385] Print warning if not resources are _currently_ available in the YARN cluster. Instead of rejecting the session

[FLINK-1385] Print warning if not resources are _currently_ available in the YARN cluster.
Instead of rejecting the session

This closes #294


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

Branch: refs/heads/release-0.8
Commit: e83ccd03cde884626588d729f6dc9e4d624c9faf
Parents: 7cd0f47
Author: Robert Metzger <me...@web.de>
Authored: Sat Jan 10 18:20:10 2015 +0100
Committer: mbalassi <mb...@apache.org>
Committed: Mon Jan 12 09:57:33 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/flink/yarn/Client.java | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/e83ccd03/flink-addons/flink-yarn/src/main/java/org/apache/flink/yarn/Client.java
----------------------------------------------------------------------
diff --git a/flink-addons/flink-yarn/src/main/java/org/apache/flink/yarn/Client.java b/flink-addons/flink-yarn/src/main/java/org/apache/flink/yarn/Client.java
index 161aa8a..2100df9 100644
--- a/flink-addons/flink-yarn/src/main/java/org/apache/flink/yarn/Client.java
+++ b/flink-addons/flink-yarn/src/main/java/org/apache/flink/yarn/Client.java
@@ -394,25 +394,22 @@ public class Client {
 			yarnClient.stop();
 			System.exit(1);
 		}
+
+		final String NOTE = "\nThe Flink YARN client will try to allocate the YARN session, but maybe not all TaskManagers are " +
+				"connecting from the beginning. The allocation might take more time than usual!";
 		int totalMemoryRequired = jmMemory + tmMemory * taskManagerCount;
 		ClusterResourceDescription freeClusterMem = getCurrentFreeClusterResources(yarnClient);
 		if(freeClusterMem.totalFreeMemory < totalMemoryRequired) {
-			LOG.error("This YARN session requires "+totalMemoryRequired+"MB of memory in the cluster. "
-					+ "There are currently only "+freeClusterMem.totalFreeMemory+"MB available.");
-			yarnClient.stop();
-			System.exit(1);
+			LOG.warn("This YARN session requires " + totalMemoryRequired + "MB of memory in the cluster. "
+					+ "There are currently only " + freeClusterMem.totalFreeMemory + "MB available." + NOTE);
 		}
 		if( tmMemory > freeClusterMem.containerLimit) {
-			LOG.error("The requested amount of memory for the TaskManagers ("+tmMemory+"MB) is more than "
-					+ "the largest possible YARN container: "+freeClusterMem.containerLimit);
-			yarnClient.stop();
-			System.exit(1);
+			LOG.warn("The requested amount of memory for the TaskManagers (" + tmMemory + "MB) is more than "
+					+ "currently the largest possible YARN container: " + freeClusterMem.containerLimit + NOTE);
 		}
 		if( jmMemory > freeClusterMem.containerLimit) {
-			LOG.error("The requested amount of memory for the JobManager ("+jmMemory+"MB) is more than "
-					+ "the largest possible YARN container: "+freeClusterMem.containerLimit);
-			yarnClient.stop();
-			System.exit(1);
+			LOG.warn("The requested amount of memory for the JobManager (" + jmMemory + "MB) is more than "
+					+ "currently the largest possible YARN container: " + freeClusterMem.containerLimit + NOTE);
 		}
 
 		// respect custom JVM options in the YAML file