srowen commented on a change in pull request #23445: [SPARK-26530]Validate 
heartheat arguments in HeartbeatReceiver
URL: https://github.com/apache/spark/pull/23445#discussion_r249820190
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala
 ##########
 @@ -79,13 +79,19 @@ private[spark] class HeartbeatReceiver(sc: SparkContext, 
clock: Clock)
   private val executorTimeoutMs =
     sc.conf.getTimeAsMs("spark.storage.blockManagerSlaveTimeoutMs",
       s"${sc.conf.getTimeAsSeconds("spark.network.timeout", "120s")}s")
+  private val executorHeartbeatIntervalMs = 
sc.conf.get(config.EXECUTOR_HEARTBEAT_INTERVAL)
 
   // "spark.network.timeoutInterval" uses "seconds", while
   // "spark.storage.blockManagerTimeoutIntervalMs" uses "milliseconds"
   private val timeoutIntervalMs =
     sc.conf.get(config.STORAGE_BLOCKMANAGER_TIMEOUTINTERVAL)
   private val checkTimeoutIntervalMs =
     sc.conf.getTimeAsSeconds("spark.network.timeoutInterval", 
s"${timeoutIntervalMs}ms") * 1000
+  
+  require(checkTimeoutIntervalMs >= executorTimeoutMs, "Incorrect heartbeat 
arguments, " +
+    "checkTimeoutIntervalMs should less than executorTimeoutMs.")
 
 Review comment:
   should less -> should be less, but one of the check or the text is wrong as 
they disagree. Don't you mean to assert these are less than the 
executorTimeoutMs ? You can reference the `.key` of the relevant property in 
the message here to tell users just what configs you're referencing.
   
   "Incorrect heartbeat arguments" isn't necessary

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to