flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [3/3] flink git commit: [FLINK-1739] [runtime] Fix the bug of the jobManager and TaskManager IPC Port Check.
Date Thu, 19 Mar 2015 16:52:04 GMT
[FLINK-1739] [runtime] Fix the bug of the jobManager and TaskManager IPC Port Check.

This closes #499


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

Branch: refs/heads/master
Commit: 0a3ef15bd584ae3706f1f1bbf3ae52530d34e92d
Parents: 6e38eb8
Author: hongsibao <hongsibao@huawei.com>
Authored: Thu Mar 19 01:06:06 2015 +0800
Committer: Stephan Ewen <sewen@apache.org>
Committed: Thu Mar 19 17:51:04 2015 +0100

----------------------------------------------------------------------
 .../org/apache/flink/runtime/jobmanager/JobManager.scala     | 8 ++++++++
 .../org/apache/flink/runtime/taskmanager/TaskManager.scala   | 5 +++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0a3ef15b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
index 5fc9faa..70a1cbb 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
@@ -677,6 +677,14 @@ object JobManager {
       System.exit(STARTUP_FAILURE_RETURN_CODE)
     }
 
+    // address and will not be reachable from anyone remote
+    if (listeningPort <= 0 || listeningPort >= 65536) {
+      val message = "Config parameter '" + ConfigConstants.JOB_MANAGER_IPC_PORT_KEY +
+        "' is invalid, it must be great than 0 and less than 65536."
+      LOG.error(message)
+      System.exit(STARTUP_FAILURE_RETURN_CODE)
+    }
+
     // run the job manager
     try {
       if (SecurityUtils.isSecurityEnabled) {

http://git-wip-us.apache.org/repos/asf/flink/blob/0a3ef15b/flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
index 61cab6b..086c2bd 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
@@ -1295,9 +1295,10 @@ object TaskManager {
         "' is missing (hostname/address of JobManager to connect to).")
     }
 
-    if (port <= 0) {
+    if (port <= 0 || port >= 65536) {
       throw new Exception("Invalid value for '" + ConfigConstants.JOB_MANAGER_IPC_PORT_KEY
+
-        "' (port of the JobManager actor system) : " + port)
+        "' (port of the JobManager actor system) : " + port +
+        ".  it must be great than 0 and less than 65536.")
     }
 
     (hostname, port)


Mime
View raw message