Skip to content

Commit f6fa337

Browse files
committed
Use getTimeAsSeconds
1 parent 9cbe14c commit f6fa337

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

core/src/main/scala/org/apache/spark/SparkConf.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,14 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria
609609
require(!encryptionEnabled || get(NETWORK_AUTH_ENABLED),
610610
s"${NETWORK_AUTH_ENABLED.key} must be enabled when enabling encryption.")
611611

612-
val executorTimeoutThreshold = getTimeAsMs("spark.network.timeout", "120s")
613-
val executorHeartbeatInterval = get(EXECUTOR_HEARTBEAT_INTERVAL)
612+
val executorTimeoutThresholdMs =
613+
getTimeAsSeconds("spark.network.timeout", "120s") * 1000
614+
val executorHeartbeatIntervalMs = get(EXECUTOR_HEARTBEAT_INTERVAL)
614615
// If spark.executor.heartbeatInterval bigger than spark.network.timeout,
615616
// it will almost always cause ExecutorLostFailure. See SPARK-22754.
616-
require(executorTimeoutThreshold > executorHeartbeatInterval, "The value of " +
617-
s"spark.network.timeout=${executorTimeoutThreshold}ms must be no less than the value of " +
618-
s"spark.executor.heartbeatInterval=${executorHeartbeatInterval}ms.")
617+
require(executorTimeoutThresholdMs > executorHeartbeatIntervalMs, "The value of " +
618+
s"spark.network.timeout=${executorTimeoutThresholdMs}ms must be no less than the value of " +
619+
s"spark.executor.heartbeatInterval=${executorHeartbeatIntervalMs}ms.")
619620
}
620621

621622
/**

0 commit comments

Comments
 (0)