-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-42785][K8S][Core] When spark submit without --deploy-mode, avoid facing NPE in Kubernetes Case
#40414
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
Conversation
|
Please use the jira-style prefix [SPARK-42785], not a GitHub issue-like one [SPARK #42785] like apache/kyuubi. Please also answer the rest of the questions in the PR description. |
|
@zwangsheng @yaooqinn There won't be any NPE if you try to actually submit a job without the deploy-mode because if no value is provided, it defaults to "client". Please refer to org.apache.spark.internal.config/package.scala. |
@shrprasa Thanks for reminder I saw this default value, you can do local test with writing following code The default value |
--deploy-mode, avoid facing NPE in Kubernetes Case--deploy-mode, avoid facing NPE in Kubernetes Case
Sure. XD |
|
I was able to reproduce the issue. Thanks @zwangsheng for fixing it. |
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you, @zwangsheng and all.
Merged to master/3.4/3.3/3.2.
…void facing NPE in Kubernetes Case ### What changes were proposed in this pull request? After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code. ### Why are the changes needed? https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164 ```scala args.deployMode.equals("client") && ``` Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?  Closes #40414 from zwangsheng/SPARK-42785. Authored-by: zwangsheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 767253b) Signed-off-by: Dongjoon Hyun <[email protected]>
…void facing NPE in Kubernetes Case ### What changes were proposed in this pull request? After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code. ### Why are the changes needed? https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164 ```scala args.deployMode.equals("client") && ``` Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?  Closes #40414 from zwangsheng/SPARK-42785. Authored-by: zwangsheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 767253b) Signed-off-by: Dongjoon Hyun <[email protected]>
…void facing NPE in Kubernetes Case ### What changes were proposed in this pull request? After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code. ### Why are the changes needed? https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164 ```scala args.deployMode.equals("client") && ``` Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?  Closes #40414 from zwangsheng/SPARK-42785. Authored-by: zwangsheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 767253b) Signed-off-by: Dongjoon Hyun <[email protected]>
…void facing NPE in Kubernetes Case ### What changes were proposed in this pull request? After apache#37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code. ### Why are the changes needed? https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164 ```scala args.deployMode.equals("client") && ``` Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?  Closes apache#40414 from zwangsheng/SPARK-42785. Authored-by: zwangsheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 767253b) Signed-off-by: Dongjoon Hyun <[email protected]>
…void facing NPE in Kubernetes Case ### What changes were proposed in this pull request? After apache#37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code. ### Why are the changes needed? https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164 ```scala args.deployMode.equals("client") && ``` Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested?  Closes apache#40414 from zwangsheng/SPARK-42785. Authored-by: zwangsheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 767253b) Signed-off-by: Dongjoon Hyun <[email protected]>

What changes were proposed in this pull request?
After #37880 when user spark submit without
--deploy-mode XXXor–conf spark.submit.deployMode=XXXX, may face NPE with this code.Why are the changes needed?
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
Of course, submit without
deployModeis not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.Does this PR introduce any user-facing change?
No
How was this patch tested?