-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7504] [YARN] NullPointerException when initializing SparkContext in YARN-cluster mode #6083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
9f287c5
39e4fa3
4924e01
ea2a5fe
7c89b6e
926bd96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -573,10 +573,16 @@ object ApplicationMaster extends Logging { | |
| } | ||
|
|
||
| private[spark] def sparkContextInitialized(sc: SparkContext): Unit = { | ||
| if (master == null){ | ||
|
||
| throw new SparkException("ApplicationMaster is not initialized!") | ||
| } | ||
| master.sparkContextInitialized(sc) | ||
| } | ||
|
|
||
| private[spark] def sparkContextStopped(sc: SparkContext): Boolean = { | ||
| if (master == null){ | ||
| throw new SparkException("ApplicationMaster is not initialized!") | ||
| } | ||
| master.sparkContextStopped(sc) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things here:
yarn-standalonesince the code still accepts that as an alias foryarn-cluster.Driveris too brittle. I think checking forspark.yarn.app.idinSparkConfis slightly better. Both are not 100% fool-proof since users can muck with them, but at least the latter is an internal API (i.e. the YARN code depends on that property to exist for other things).