Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/main/scala/org/apache/spark/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@ private[spark] class Executor(
* Schedules a task to report heartbeat and partial metrics for active tasks to driver.
*/
private def startDriverHeartbeater(): Unit = {
val intervalMs = conf.getTimeAsMs("spark.executor.heartbeatInterval", "10s")
val intervalMs = conf

@srowen srowen Mar 19, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In branch 2.4 this is accessed both with getTimeAsSeconds and getTimeAsMs, yes. The only question is which interpretation was intended? it's not a best practice to not specify the units, but hey it can happen.

In master, this is interpreted as milliseconds by default. I think we should instead switch how it's read in SparkConf instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, seems more reasonable as it also avoids the scenario @MaxGekk mentioned. Will modify the PR accordingly

.getTimeAsSeconds("spark.executor.heartbeatInterval", "10s") *
TimeUnit.SECONDS.toMillis(1)

// Wait a random interval so the heartbeats don't end up in sync
val initialDelay = intervalMs + (math.random * intervalMs).asInstanceOf[Int]
Expand Down