Github user subrotosanyal commented on a diff in the pull request: https://github.com/apache/spark/pull/13658#discussion_r67020544 --- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala --- @@ -513,13 +517,16 @@ private[spark] class ApplicationMaster( logInfo("Waiting for spark context initialization ... ") sparkContextRef.wait(10000L) } - - val sparkContext = sparkContextRef.get() - if (sparkContext == null) { - logError(("SparkContext did not initialize after waiting for %d ms. Please check earlier" - + " log output for errors. Failing the application.").format(totalWaitTime)) + if (!finished) { + val sparkContext = sparkContextRef.get() + if (sparkContext == null) { + logError(("SparkContext did not initialize after waiting for %d ms. Please check earlier" + + " log output for errors. Failing the application.").format(totalWaitTime)) + } else { + Some(sparkContext) + } } - sparkContext + None --- End diff -- hi @jerryshao I am not so good in Scala coding, infact this is the first or second time I am touching scala code :) I expected the previous line Some(sparkContext) is going to do the trick but, looks like I need to fix that.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org