Skip to content
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

[SPARK-24680][Deploy]Support spark.executorEnv.JAVA_HOME in Standalone mode #21663

Closed
wants to merge 2 commits into from

Conversation

stanzhai
Copy link
Contributor

What changes were proposed in this pull request?

spark.executorEnv.JAVA_HOME does not take effect when a Worker starting an Executor process in Standalone mode.

This PR fixed this.

How was this patch tested?

Manual tests.

@jerryshao
Copy link
Contributor

Can you please describe the usage scenario for this under standalone mode? I know it is used in yarn mode, because Hadoop and Spark are two distributions, they may build and run with different JVMs, but standalone cluster manager is distributed with Spark package, so I'm not sure the real use case here.

Also I'm not sure if there's an issue in RPC communication. For example if standalone cluster manager is running with JDK7 and Spark application is JDK8, I'm not sure if JDK8 serialized message from executors can be read by JDK7 worker, have you tried this?

@stanzhai
Copy link
Contributor Author

stanzhai commented Jul 5, 2018

@jerryshao My Spark Application is built on top of JDK10, but the standalone cluster manager is running with JDK8 which does not support JDK10.

Java 7 support has been removed since Spark 2.2.

I've tried that JDK10 serialized message from executors which can be read by JDK8 worker.

Aside from that, I think we should let the spark.executorEnv.JAVA_HOME configuration work, and as for effectiveness, we should give it to the user.

@jerryshao
Copy link
Contributor

I see, thanks for verifying. I'm neutral to the fix, because I cannot see the strong requirement of this feature compared to running on YARN, usually in standalone mode we deploy standalone cluster manager together with runtime.

@@ -95,10 +95,12 @@

if (javaHome != null) {
cmd.add(join(File.separator, javaHome, "bin", "java"));
} else if (childEnv.containsKey("JAVA_HOME")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change could be fine, but I wonder if we can rewrite the logic so that these cases update a variable tracking what the Java home is, and add the command once at the end. The logic is duplicated four times here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srowen The logic has been updated, please review the code, thanks.

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: at least the sys property java.home is guaranteed to always be set, so this will always add a command.

@SparkQA
Copy link

SparkQA commented Dec 17, 2018

Test build #4480 has finished for PR 21663 at commit b9c2923.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Dec 18, 2018

Merged to master

@srowen srowen closed this in 4d693ac Dec 18, 2018
holdenk pushed a commit to holdenk/spark that referenced this pull request Jan 5, 2019
…ne mode

## What changes were proposed in this pull request?

spark.executorEnv.JAVA_HOME does not take effect when a Worker starting an Executor process in Standalone mode.

This PR fixed this.

## How was this patch tested?

Manual tests.

Closes apache#21663 from stanzhai/fix-executor-env-java-home.

Lead-authored-by: Stan Zhai <zhaishidan@haizhi.com>
Co-authored-by: Stan Zhai <mail@stanzhai.site>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…ne mode

## What changes were proposed in this pull request?

spark.executorEnv.JAVA_HOME does not take effect when a Worker starting an Executor process in Standalone mode.

This PR fixed this.

## How was this patch tested?

Manual tests.

Closes apache#21663 from stanzhai/fix-executor-env-java-home.

Lead-authored-by: Stan Zhai <zhaishidan@haizhi.com>
Co-authored-by: Stan Zhai <mail@stanzhai.site>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants