@@ -58,6 +58,8 @@ private[spark] class Client(
5858 " spark.kubernetes.driver.docker.image" , s " spark-driver: $SPARK_VERSION" )
5959 private val uploadedJars = sparkConf.getOption(" spark.kubernetes.driver.uploads.jars" )
6060 private val uiPort = sparkConf.getInt(" spark.ui.port" , DEFAULT_UI_PORT )
61+ private val driverLaunchTimeoutSecs = sparkConf.getTimeAsSeconds(
62+ " spark.kubernetes.driverLaunchTimeout" , s " ${DEFAULT_LAUNCH_TIMEOUT_SECONDS }s " )
6163
6264 private val secretBase64String = {
6365 val secretBytes = new Array [Byte ](128 )
@@ -254,7 +256,7 @@ private[spark] class Client(
254256 .done()
255257 var submitSucceeded = false
256258 try {
257- submitCompletedFuture.get(LAUNCH_TIMEOUT_SECONDS , TimeUnit .SECONDS )
259+ submitCompletedFuture.get(driverLaunchTimeoutSecs , TimeUnit .SECONDS )
258260 submitSucceeded = true
259261 } catch {
260262 case e : TimeoutException =>
@@ -290,10 +292,10 @@ private[spark] class Client(
290292 kubernetesClient.pods().withName(kubernetesAppId).get()
291293 } catch {
292294 case throwable : Throwable =>
293- logError(s " Timed out while waiting $LAUNCH_TIMEOUT_SECONDS seconds for the " +
295+ logError(s " Timed out while waiting $driverLaunchTimeoutSecs seconds for the " +
294296 " driver pod to start, but an error occurred while fetching the driver" +
295297 " pod's details." , throwable)
296- throw new SparkException (s " Timed out while waiting $LAUNCH_TIMEOUT_SECONDS " +
298+ throw new SparkException (s " Timed out while waiting $driverLaunchTimeoutSecs " +
297299 " seconds for the driver pod to start. Unfortunately, in attempting to fetch" +
298300 " the latest state of the pod, another error was thrown. Check the logs for" +
299301 " the error that was thrown in looking up the driver pod." , e)
@@ -440,7 +442,7 @@ private[spark] object Client extends Logging {
440442 private val DRIVER_LAUNCHER_CONTAINER_NAME = " spark-kubernetes-driver-launcher"
441443 private val SECURE_RANDOM = new SecureRandom ()
442444 private val SPARK_SUBMISSION_SECRET_BASE_DIR = " /var/run/secrets/spark-submission"
443- private val LAUNCH_TIMEOUT_SECONDS = 30
445+ private val DEFAULT_LAUNCH_TIMEOUT_SECONDS = 60
444446 private val SPARK_APP_NAME_LABEL = " spark-app-name"
445447
446448 def main (args : Array [String ]): Unit = {
0 commit comments