You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2020/06/09 09:51:00 UTC
[jira] [Commented] (SPARK-31941) Handling the exception in SparkUI
for getSparkUser method
[ https://issues.apache.org/jira/browse/SPARK-31941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17129073#comment-17129073 ]
Apache Spark commented on SPARK-31941:
--------------------------------------
User 'SaurabhChawla100' has created a pull request for this issue:
https://github.com/apache/spark/pull/28768
> Handling the exception in SparkUI for getSparkUser method
> ---------------------------------------------------------
>
> Key: SPARK-31941
> URL: https://issues.apache.org/jira/browse/SPARK-31941
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 3.1.0
> Reporter: Saurabh Chawla
> Priority: Minor
>
> After SPARK-31632 SparkException is thrown from def applicationInfo(
> {code:java}
> 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.")
> }
> }
> {code}
> Where as the caller for this method def getSparkUser in Spark UI is not handling SparkException in the catch
> {code:java}
> def getSparkUser: String = {
> try {
> Option(store.applicationInfo().attempts.head.sparkUser)
> .orElse(store.environmentInfo().systemProperties.toMap.get("user.name"))
> .getOrElse("<unknown>")
> } catch {
> case _: NoSuchElementException => "<unknown>"
> }
> }
> {code}
> So On using this method (getSparkUser )we can get the application erred out.
> So either we should thow
> {code:java}
> throw new NoSuchElementException("Failed to get the application information. " +
> "If you are starting up Spark, please wait a while until it's ready.")
> {code}
> or else add the scenario to catch spark exception in getSparkUser
> case _: SparkException => "<unknown>"
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org