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

[Bug][DISTRIBUTION][2.0.0]: Plugin build fails for JDK lower than 17 (11 and 14) #2581

Closed
martin-gaievski opened this issue Mar 23, 2022 · 10 comments · Fixed by #2596
Closed
Assignees
Labels
bug Something isn't working untriaged v2.0.0 Version 2.0.0

Comments

@martin-gaievski
Copy link
Member

martin-gaievski commented Mar 23, 2022

Describe the bug

Build for kNN plugin PRs fail when JDK 11 or JDK 14 has been used.

Example of failed build - https://github.com/opensearch-project/k-NN/runs/5668411237?check_suite_focus=true.

Error in the log:

Reaper process died unexpectedly! Check the log at /home/runner/work/k-NN/k-NN/.gradle/reaper/build-1813/reaper.log

reaper.log:

Error: LinkageError occurred while loading main class org.opensearch.gradle.reaper.Reaper
        java.lang.UnsupportedClassVersionError: org/opensearch/gradle/reaper/Reaper has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 58.0

More details exception is here - https://gist.github.com/martin-gaievski/ea1d3918e940c348f5e13dc5f9cc27a6.

The error comes at the very end of the build, when all tasks are finished successfully.

Locally I'm able to build is successfully for JDK 17, same as a github action has been cancelled as soon as build for JDK 14 fails.

This PR that uses OpenSearch 2.0.0-alpha1-SNAPSHOT, with added support for the build.version_qualifier.

To reproduce

Feel free to restart https://github.com/opensearch-project/k-NN/runs/5668411237?check_suite_focus=true failed task for JDK 11 or JDK 14, or download https://github.com/martin-gaievski/k-NN/tree/integrate/opensearch20-lucene91 and try to build is locally with JDK 14.

Expected behavior

Build should finish successfully, same as for JDK 17.

@peterzhuamazon
Copy link
Member

This seems like a core issue, will transfer to core repo once confirmed.
cc: @CEHENKLE
Thanks.

@peterzhuamazon peterzhuamazon removed their assignment Mar 24, 2022
@peterzhuamazon peterzhuamazon transferred this issue from opensearch-project/opensearch-build Mar 24, 2022
@peterzhuamazon peterzhuamazon added the v2.0.0 Version 2.0.0 label Mar 24, 2022
@peterzhuamazon peterzhuamazon changed the title [Bug]: Plugin build fails for JDK lower than 17 (11 and 14) [Bug][DISTRIBUTION][2.0.0]: Plugin build fails for JDK lower than 17 (11 and 14) Mar 24, 2022
@Rishikesh1159
Copy link
Member

moved to opensearch repo, so closing this issue here for now.

@Rishikesh1159
Copy link
Member

Rishikesh1159 commented Mar 25, 2022

Looks like this PR #2407 was causing the failures on plugin. When I revert this PR, build was successful. I will further dig and see which change in PR caused this and update more info here

@Rishikesh1159
Copy link
Member

This

reaper.registerPid(toString(), opensearchProcess.pid());
line in PR where method call registerPid() happens, is having problem. This call tries to register and then later kill Pid, this is failing somehow and plugins are getting failed here. I will try to sync up and get suggestions from @dblock in how to move forward to a fix for this.

@dblock
Copy link
Member

dblock commented Mar 25, 2022

The reaper code was taken out when we re-introduced compatibility with JDK8, then put back in #2407. If the reaper is broken, it should just be fixed.

@dblock
Copy link
Member

dblock commented Mar 25, 2022

Is this error saying that the code did not use the correct source/target version when built with JDK17? @reta amirite?

"Error: LinkageError occurred while loading main class org.opensearch.gradle.reaper.Reaper
java.lang.UnsupportedClassVersionError: org/opensearch/gradle/reaper/Reaper has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 58.0

@reta
Copy link
Collaborator

reta commented Mar 25, 2022

@dblock looking, the source/runtime level should be 11

@reta
Copy link
Collaborator

reta commented Mar 25, 2022

@dblock I think I figured it out, the reaper does not inherit source / runtime setting, uses whatever JDK it is being built with, fixing that

@Rishikesh1159
Copy link
Member

Thank you @reta I tried your fix in local. It fixed this issue.

@CEHENKLE
Copy link
Member

@reta You are a rockstar :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged v2.0.0 Version 2.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants