Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18887#discussion_r141087495
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -243,42 +282,38 @@ private[history] class FsHistoryProvider(conf: 
SparkConf, clock: Clock)
     
       override def getAppUI(appId: String, attemptId: Option[String]): 
Option[LoadedAppUI] = {
         try {
    -      applications.get(appId).flatMap { appInfo =>
    -        appInfo.attempts.find(_.attemptId == attemptId).flatMap { attempt 
=>
    +      val appInfo = load(appId)
    +      appInfo.attempts
    +        .find { attempt => attempt.info.attemptId == attemptId }
    +        .map { attempt =>
               val replayBus = new ReplayListenerBus()
               val ui = {
                 val conf = this.conf.clone()
                 val appSecManager = new SecurityManager(conf)
    -            SparkUI.createHistoryUI(conf, replayBus, appSecManager, 
appInfo.name,
    -              HistoryServer.getAttemptURI(appId, attempt.attemptId),
    -              Some(attempt.lastUpdated), attempt.startTime)
    +            SparkUI.createHistoryUI(conf, replayBus, appSecManager, 
appInfo.info.name,
    +              HistoryServer.getAttemptURI(appId, attempt.info.attemptId),
    +              Some(attempt.info.lastUpdated.getTime()), 
attempt.info.startTime.getTime())
                 // Do not call ui.bind() to avoid creating a new server for 
each application
               }
     
               val fileStatus = fs.getFileStatus(new Path(logDir, 
attempt.logPath))
     
               val appListener = replay(fileStatus, 
isApplicationCompleted(fileStatus), replayBus)
    -
    -          if (appListener.appId.isDefined) {
    -            ui.appSparkVersion = appListener.appSparkVersion.getOrElse("")
    -            ui.getSecurityManager.setAcls(HISTORY_UI_ACLS_ENABLE)
    -            // make sure to set admin acls before view acls so they are 
properly picked up
    -            val adminAcls = HISTORY_UI_ADMIN_ACLS + "," + 
appListener.adminAcls.getOrElse("")
    -            ui.getSecurityManager.setAdminAcls(adminAcls)
    -            ui.getSecurityManager.setViewAcls(attempt.sparkUser, 
appListener.viewAcls.getOrElse(""))
    -            val adminAclsGroups = HISTORY_UI_ADMIN_ACLS_GROUPS + "," +
    -              appListener.adminAclsGroups.getOrElse("")
    -            ui.getSecurityManager.setAdminAclsGroups(adminAclsGroups)
    -            
ui.getSecurityManager.setViewAclsGroups(appListener.viewAclsGroups.getOrElse(""))
    -            Some(LoadedAppUI(ui, () => updateProbe(appId, attemptId, 
attempt.fileSize)))
    -          } else {
    -            None
    -          }
    -
    +          ui.appSparkVersion = appListener.appSparkVersion.getOrElse("")
    --- End diff --
    
    add an `assert(appListener.appId.isDefined)`?


---

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

Reply via email to