@@ -59,12 +59,10 @@ private[spark] class AppStatusListener(
5959 private val liveUpdatePeriodNs = if (live) conf.get(LIVE_ENTITY_UPDATE_PERIOD ) else - 1L
6060
6161 /**
62- * A time limit before we force to flush all live entities. When the last flush doesn't past
63- * this limit, UI will not trigger a heavy flush to sync the states since it may slow down Spark
64- * events processing significantly. Otherwise, UI will try to flush when receiving the next
65- * executor heartbeat.
62+ * Minimum time elapsed before stale UI data is flushed. This avoids UI staleness when incoming
63+ * task events are not fired frequently.
6664 */
67- private val liveUpdateStalenessLimit = conf.get(LIVE_ENTITY_UPDATE_STALENESS_LIMIT )
65+ private val liveUpdateMinFlushPeriod = conf.get(LIVE_ENTITY_UPDATE_MIN_FLUSH_PERIOD )
6866
6967 private val maxTasksPerStage = conf.get(MAX_RETAINED_TASKS_PER_STAGE )
7068 private val maxGraphRootNodes = conf.get(MAX_RETAINED_ROOT_NODES )
@@ -845,8 +843,8 @@ private[spark] class AppStatusListener(
845843 }
846844 // Flush updates if necessary. Executor heartbeat is an event that happens periodically. Flush
847845 // here to ensure the staleness of Spark UI doesn't last more than
848- // `max(heartbeat interval, liveUpdateStalenessLimit )`.
849- if (now - lastFlushTimeNs > liveUpdateStalenessLimit ) {
846+ // `max(heartbeat interval, liveUpdateMinFlushPeriod )`.
847+ if (now - lastFlushTimeNs > liveUpdateMinFlushPeriod ) {
850848 flush(maybeUpdate(_, now))
851849 // Re-get the current system time because `flush` may be slow and `now` is stale.
852850 lastFlushTimeNs = System .nanoTime()
0 commit comments