Skip to content
Snippets Groups Projects
Commit bd078850 authored by Ali Ghodsi's avatar Ali Ghodsi
Browse files

Using configured akka timeouts

parent e452bd6d
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ import org.apache.spark.deploy.DeployMessages._
import org.apache.spark.deploy.master.ui.MasterWebUI
import org.apache.spark.metrics.MetricsSystem
import org.apache.spark.util.{Utils, AkkaUtils}
import akka.util.Timeout
import akka.util.{Duration, Timeout}
import java.util.concurrent.TimeUnit
......@@ -389,9 +389,11 @@ private[spark] object Master {
def startSystemAndActor(host: String, port: Int, webUiPort: Int): (ActorSystem, Int, Int) = {
val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port)
val actor = actorSystem.actorOf(Props(new Master(host, boundPort, webUiPort)), name = actorName)
implicit val timeout = Timeout(5 seconds)
val timeoutDuration = Duration.create(
System.getProperty("spark.akka.askTimeout", "10").toLong, "seconds")
implicit val timeout = Timeout(timeoutDuration)
val respFuture = actor ? RequestWebUIPort // ask pattern
val resp = Await.result(respFuture, timeout.duration).asInstanceOf[WebUIPortResponse]
val resp = Await.result(respFuture, timeoutDuration).asInstanceOf[WebUIPortResponse]
(actorSystem, boundPort, resp.webUIBoundPort)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment