-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-27397][Core] Take care of OpenJ9 JVM in Spark #24308
Conversation
Test build #104339 has finished for PR 24308 at commit
|
Retest this please |
Hi, @kiszk . Could you update |
Test build #104342 has finished for PR 24308 at commit
|
// java.vm.info provides compressed ref info for IBM JDKs | ||
if (System.getProperty("java.vendor").contains("IBM")) { | ||
// java.vm.info provides compressed ref info for IBM and OpenJ9 JDKs | ||
if (System.getProperty("java.vendor").contains("IBM") || |
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.
Nit: do you want to retrieve the value of java.vendor once here and compare it twice? the overall change seems fine, though I don't know if it means these JDKs will always work. We only test against the Oracle/OpenJDK
Test build #104348 has finished for PR 24308 at commit
|
@kiszk . Although JDK8 doesn't have |
Test build #4696 has finished for PR 24308 at commit
|
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.
@kiszk . It seems to require additional installation steps to pass the UT.
During local verification, I'm facing the following UT failure due to Zstd JNI issue.
In the PR description, could you add a guide about how to pass the UT in OpenJ9?
Oracle JDK8
~/P/PR-24308:PR-24308$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
~/P/PR-24308:PR-24308$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
~/P/PR-24308:PR-24308$ build/sbt "core/testOnly *.EventLoggingListenerSuite"
Using /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home as default JAVA_HOME.
...
[info] All tests passed.
[info] Passed: Total 9, Failed 0, Errors 0, Passed 9
[success] Total time: 123 s, completed Apr 7, 2019 5:34:03 PM
OpenJ9 JDK8
~/P/PR-24308:PR-24308$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk8u202-b08/Contents/Home/
~/P/PR-24308:PR-24308$ java -version
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (build 1.8.0_202-b08)
Eclipse OpenJ9 VM (build openj9-0.12.1, JRE 1.8.0 Mac OS X amd64-64-Bit 20190205_1 (JIT enabled, AOT enabled)
OpenJ9 - 90dd8cb40
OMR - d2f4534b
JCL - d002501a90 based on jdk8u202-b08)
~/P/PR-24308:PR-24308$ build/sbt "core/testOnly *.EventLoggingListenerSuite"
Using /Library/Java/JavaVirtualMachines/jdk8u202-b08/Contents/Home/ as default JAVA_HOME.
Note, this will be overridden by -java-home if it is set.
...
[info] EventLoggingListenerSuite:
[info] - Verify log file exist (394 milliseconds)
[info] - Basic event logging (1 second, 307 milliseconds)
[info] org.apache.spark.scheduler.EventLoggingListenerSuite *** ABORTED *** (2 seconds, 118 milliseconds)
[info] java.lang.UnsatisfiedLinkError: zstd-jni (Not found in java.library.path)
[info] Unsupported OS/arch, cannot find /darwin/amd64/libzstd-jni.dylib or load zstd-jni from system libraries. Please try building from source the jar or providing libzstd-jni in you system.
[info] at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1434)
[info] at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1404)
[info] at java.lang.System.loadLibrary(System.java:540)
[info] at com.github.luben.zstd.util.Native.load(Native.java:69)
[info] at com.github.luben.zstd.ZstdOutputStream.<clinit>(ZstdOutputStream.java:17)
[info] at org.apache.spark.io.ZStdCompressionCodec.compressedOutputStream(CompressionCodec.scala:197)
...
[info] *** 1 SUITE ABORTED ***
[error] Error: Total 1, Failed 0, Errors 1, Passed 0
[error] Error during tests:
[error] org.apache.spark.scheduler.EventLoggingListenerSuite
[error] (core/test:testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 156 s, completed Apr 7, 2019 5:38:22 PM
@@ -124,6 +124,9 @@ static JavaVendor getJavaVendor() { | |||
if (vendorString.contains("OpenJDK")) { | |||
return JavaVendor.OpenJDK; | |||
} | |||
if (vendorString.contains("OpenJ9")) { |
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.
Do you know who uses this getJavaVendor
method?
As it is package private so only classes from the same package could access this.
But in the entire Spark code there is no usage for it:
$ find . -type f -exec grep "getJavaVendor" \{} \; -print
static JavaVendor getJavaVendor() {
./launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java
Could it be a 3rd party tool should use the package name: org.apache.spark.launcher
?
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.
Hm yeah it's unused as far as I can see. It shouldn't be used by third parties anyway. Delete it?
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.
There is one more method near this one also seams to me unused: firstNonEmptyValue
. Should I create a Minor PR or OK to remove within this PR?
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.
Oh and there will be the enum as well: getJavaVendor
seams to me the only place where used (and mima exclude).
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.
Agree, you can delete the unused code here.
It looks like this was added to account for the fact that IBM JDKs don't have a PermGen, but Spark no longer tries to set this now that Java 8 is required and doesn't have a PermGen.
@dongjoon-hyun Thank you. I will address them on middle or late this week since I am on a business trip this week. |
When I came back to home (I leave Mac at home), I realized that this link issue occurs only on Mac. In addition, I realized that this is not an issue in Spark. May be in OpenJ9 or zstd. I am investigating this now. |
@dongjoon-hyun I created an issue on OpenJ9 to address a jni link issue. OpenJ9 will be updated in July. |
Test build #104580 has finished for PR 24308 at commit
|
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.
Thank you, @kiszk .
Please mentioned the reported issue in the PR description.
For the rest, +1, LGTM for this PR.
Merged to master |
What changes were proposed in this pull request?
This PR supports
OpenJ9
in addition toIBM JDK
andOpenJDK
in Spark by handlingSystem.getProperty("java.vendor") = "Eclipse OpenJ9"
.In
inferDefaultMemory()
andgetKrb5LoginModuleName()
, this PR uses nonIBM
way.How was this patch tested?
Existing test suites
Manual testing with OpenJ9.
Note
Beyond the scope of this PR, OpenJ9 on Mac has an issue with
zstd-jni
.As @dongjoon-hyun found here, multiple tests that use
zstd-jni
fails with OpenJ9 on Mac. This is an issue in OpenJ9