Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/10284#discussion_r47560681
--- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala
---
@@ -924,49 +939,74 @@ private[deploy] class Master(
* Return the UI if successful, else None
*/
private[master] def rebuildSparkUI(app: ApplicationInfo):
Option[SparkUI] = {
+ val futureUI = asyncRebuildSparkUI(app)
+
+ // Wait until the UI is rebuilt or cancelled, log status occasionally
for apps with many events
+ var waitSec = 2
+ do {
+ try {
+ val ui = Await.result(futureUI, Duration(waitSec,
TimeUnit.SECONDS))
+ return Some(ui)
+ } catch {
+ case te: TimeoutException =>
+ waitSec *= 2
+ logInfo(s"Application UI is rebuilding, will continue to wait
$waitSec seconds")
+ case NonFatal(_) | _: InterruptedException =>
+ waitSec = 0
+ }
+ } while (waitSec > 0)
+ None
+ }
+
+ /** Rebuild a new SparkUI asynchronously to not block RPC event loop */
+ private[master] def asyncRebuildSparkUI(app: ApplicationInfo):
Future[SparkUI] = {
val appName = app.desc.name
val notFoundBasePath = HistoryServer.UI_PATH_PREFIX + "/not-found"
- try {
- val eventLogDir = app.desc.eventLogDir
- .getOrElse {
- // Event logging is not enabled for this application
- app.appUIUrlAtHistoryServer = Some(notFoundBasePath)
- return None
- }
+ val futureUI = Future {
+
--- End diff --
remove blank line
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]