Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.4.6, 3.0.0, 3.1.0
-
None
Description
After SPARK-31632 SparkException is thrown from def applicationInfo(
def applicationInfo(): v1.ApplicationInfo = { try { // The ApplicationInfo may not be available when Spark is starting up. store.view(classOf[ApplicationInfoWrapper]).max(1).iterator().next().info } catch { case _: NoSuchElementException => throw new SparkException("Failed to get the application information. " + "If you are starting up Spark, please wait a while until it's ready.") } }
Where as the caller for this method def getSparkUser in Spark UI is not handling SparkException in the catch
def getSparkUser: String = { try { Option(store.applicationInfo().attempts.head.sparkUser) .orElse(store.environmentInfo().systemProperties.toMap.get("user.name")) .getOrElse("<unknown>") } catch { case _: NoSuchElementException => "<unknown>" } }
So On using this method (getSparkUser )we can get the application erred out.
So either we should thow
throw new NoSuchElementException("Failed to get the application information. " + "If you are starting up Spark, please wait a while until it's ready.")
or else add the scenario to catch spark exception in getSparkUser
case _: SparkException => "<unknown>"