[SPARK-45197][CORE] Make StandaloneRestServer add JavaModuleOptions to drivers#42975
Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-45197][CORE] Make StandaloneRestServer add JavaModuleOptions to drivers#42975dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
StandaloneRestServer add JavaModuleOptions to drivers#42975dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Conversation
StandaloneRestServer add JavaModuleOptions to drivers
dongjoon-hyun
commented
Sep 18, 2023
Member
Author
There was a problem hiding this comment.
This private method arguments are revised for better testing by taking advantage of dependency injection pattern.
1f2bf2b to
6f56aab
Compare
yaooqinn
approved these changes
Sep 18, 2023
LuciferYang
approved these changes
Sep 18, 2023
Member
Author
|
Thank you always, @yaooqinn and @LuciferYang ! |
Member
Author
|
Merged to master. |
viirya
pushed a commit
to viirya/spark-1
that referenced
this pull request
Oct 19, 2023
…s` to drivers ### What changes were proposed in this pull request? This PR aims to make `StandaloneRestServer` add `JavaModuleOptions` to drivers by default. ### Why are the changes needed? Since Apache Spark 3.3.0 (SPARK-36796, apache#34153), `SparkContext` adds `JavaModuleOptions` by default. We had better add `JavaModuleOptions` when `StandaloneRestServer` receives submissions via REST API, too. Otherwise, it fails like the following if the users don't set it manually. **SUBMISSION** ```bash $ SPARK_MASTER_OPTS="-Dspark.master.rest.enabled=true" sbin/start-master.sh $ curl -s -k -XPOST http://yourserver:6066/v1/submissions/create \ --header "Content-Type:application/json;charset=UTF-8" \ --data '{ "appResource": "", "sparkProperties": { "spark.master": "local[2]", "spark.app.name": "Test 1", "spark.submit.deployMode": "cluster", "spark.jars": "/Users/dongjoon/APACHE/spark-release/spark-3.5.0-bin-hadoop3/examples/jars/spark-examples_2.12-3.5.0.jar" }, "clientSparkVersion": "", "mainClass": "org.apache.spark.examples.SparkPi", "environmentVariables": {}, "action": "CreateSubmissionRequest", "appArgs": [] }' ``` **DRIVER `stderr` LOG** ``` Exception in thread "main" java.lang.reflect.InvocationTargetException ... at org.apache.spark.deploy.worker.DriverWrapper.main(DriverWrapper.scala) Caused by: java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$ (in unnamed module 0x6d7a93c9) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module 0x6d7a93c9 ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs with the newly added test case. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#42975 from dongjoon-hyun/SPARK-45197. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR aims to make
StandaloneRestServeraddJavaModuleOptionsto drivers by default.Why are the changes needed?
Since Apache Spark 3.3.0 (SPARK-36796, #34153),
SparkContextaddsJavaModuleOptionsby default.We had better add
JavaModuleOptionswhenStandaloneRestServerreceives submissions via REST API, too. Otherwise, it fails like the following if the users don't set it manually.SUBMISSION
DRIVER
stderrLOGDoes this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the CIs with the newly added test case.
Was this patch authored or co-authored using generative AI tooling?
No.