Skip to content

Commit

Permalink
[SPARK-46330] Loading of Spark UI blocks for a long time when HybridS…
Browse files Browse the repository at this point in the history
…tore enabled

### What changes were proposed in this pull request?
Move `LoadedAppUI` invalidate operation out of `FsHistoryProvider` synchronized block.

### Why are the changes needed?
When closing a HybridStore of a `LoadedAppUI` with a lot of data waiting to be written to disk, loading of other Spark UIs will be blocked for a long time.

See more details at https://issues.apache.org/jira/browse/SPARK-46330

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Passed existing tests.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #44260 from zhouyifan279/SPARK-46330.

Authored-by: zhouyifan279 <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
  • Loading branch information
zhouyifan279 authored and yaooqinn committed Dec 20, 2023
1 parent 9fdc375 commit cf54e8f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
* UI lifecycle.
*/
private def invalidateUI(appId: String, attemptId: Option[String]): Unit = {
synchronized {
activeUIs.get((appId, attemptId)).foreach { ui =>
ui.invalidate()
ui.ui.store.close()
}
val uiOption = synchronized {
activeUIs.get((appId, attemptId))
}
uiOption.foreach { ui =>
ui.invalidate()
ui.ui.store.close()
}
}

Expand Down

0 comments on commit cf54e8f

Please sign in to comment.