Skip to content

Commit a9dbda8

Browse files
do not retry when service starts on public port
1 parent 29163c5 commit a9dbda8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

core/src/main/scala/org/apache/spark/deploy/master/Master.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,8 @@ private[deploy] object Master extends Logging {
927927
webUiPort: Int,
928928
conf: SparkConf): (ActorSystem, Int, Int, Option[Int]) = {
929929
val securityMgr = new SecurityManager(conf)
930-
val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port, conf = conf,
931-
securityManager = securityMgr)
930+
val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port,
931+
conf.clone.set("spark.port.maxRetries", "0"), securityManager = securityMgr)
932932
val actor = actorSystem.actorOf(
933933
Props(classOf[Master], host, boundPort, webUiPort, securityMgr, conf), actorName)
934934
val timeout = RpcUtils.askTimeout(conf)

core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ private[deploy] class StandaloneRestServer(
8181

8282
/** Start the server and return the bound port. */
8383
def start(): Int = {
84-
val (server, boundPort) = Utils.startServiceOnPort[Server](requestedPort, doStart, masterConf)
84+
val (server, boundPort) = Utils.startServiceOnPort[Server](requestedPort, doStart,
85+
masterConf.clone.set("spark.port.maxRetries", "0"))
8586
_server = Some(server)
8687
logInfo(s"Started REST server for submitting applications on port $boundPort")
8788
boundPort

0 commit comments

Comments
 (0)