diff options
author | scwf <wangfei1@huawei.com> | 2014-10-01 11:30:29 -0700 |
---|---|---|
committer | Andrew Or <andrewor14@gmail.com> | 2014-10-01 11:30:29 -0700 |
commit | 6390aae4eacbabfb1c53fb828b824f6a6518beff (patch) | |
tree | 7b47aabcf98a90238334acee7c23f06b11b1b08b /core/src/main/scala | |
parent | dcb2f73f1cf1f6efd5175267e135ad6cf4bf6e3d (diff) | |
download | spark-6390aae4eacbabfb1c53fb828b824f6a6518beff.tar.gz spark-6390aae4eacbabfb1c53fb828b824f6a6518beff.tar.bz2 spark-6390aae4eacbabfb1c53fb828b824f6a6518beff.zip |
[SPARK-3755][Core] Do not bind port 1 - 1024 to server in spark
Non-root user use port 1- 1024 to start jetty server will get the exception " java.net.SocketException: Permission denied", so not use these ports
Author: scwf <wangfei1@huawei.com>
Closes #2610 from scwf/1-1024 and squashes the following commits:
cb8cc76 [scwf] do not use port 1 - 1024
Diffstat (limited to 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/org/apache/spark/util/Utils.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index dbe0cfa2b8..1d80012dc1 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -1437,7 +1437,7 @@ private[spark] object Utils extends Logging { val serviceString = if (serviceName.isEmpty) "" else s" '$serviceName'" for (offset <- 0 to maxRetries) { // Do not increment port if startPort is 0, which is treated as a special port - val tryPort = if (startPort == 0) startPort else (startPort + offset) % 65536 + val tryPort = if (startPort == 0) startPort else (startPort + offset) % (65536 - 1024) + 1024 try { val (service, port) = startService(tryPort) logInfo(s"Successfully started service$serviceString on port $port.") |