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

Claim full support for Java 17. #14384

Merged
merged 41 commits into from
Jul 7, 2023
Merged

Claim full support for Java 17. #14384

merged 41 commits into from
Jul 7, 2023

Conversation

gianm
Copy link
Contributor

@gianm gianm commented Jun 7, 2023

No production code has changed, except the startup scripts.

Some production Java code has changed:

  1. Add opens and exports in ForkingTaskRunner, rather than relying on
    bin/run-java. I expect this would be more robust.

  2. Minor changes to fix or suppress issues noticed by the errorprone upgrade.

Script, doc, test changes:

  1. Allow Java 17 without DRUID_SKIP_JAVA_CHECK.

  2. Include the full list of opens and exports on both Java 11 and 17.

  3. Document that Java 17 is both supported and preferred.

  4. Switch some tests from Java 11 to 17 to get better coverage on the
    preferred version.

  5. Update errorprone to a version that supports Java 17.

Fixes #12838.

No production code has changed, except the startup scripts.

Changes:

1) Allow Java 17 without DRUID_SKIP_JAVA_CHECK.

2) Include the full list of opens and exports on both Java 11 and 17.

3) Document that Java 17 is both supported and preferred.

4) Switch some tests from Java 11 to 17 to get better coverage on the
   preferred version.
Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

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

sgtm, 👍 (after CI, didn't look into why it is failing)

I was using java 17 with no issue for quite some time in most of my local development until fairly recently where I have switched to java 20 (which has some dependency problems for some tests such as the equalsverifier stuff which maybe needs to be updated to be cool).

@@ -85,29 +80,22 @@ these JVMs is given by `druid.indexer.runner.javaOptsArray` or `druid.indexer.ru
a line like the following:

```
druid.indexer.runner.javaOptsArray=["-server","-Xms1g","-Xmx1g","-XX:MaxDirectMemorySize=1g","-Duser.timezone=UTC","-Dfile.encoding=UTF-8","-XX:+ExitOnOutOfMemoryError","-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager","--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED","--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED","--add-opens=java.base/java.lang=ALL-UNNAMED","--add-opens=java.base/java.io=ALL-UNNAMED","--add-opens=java.base/java.nio=ALL-UNNAMED","--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED","--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"]
druid.indexer.runner.javaOptsArray=["-server","-Xms1g","-Xmx1g","-XX:MaxDirectMemorySize=1g","-Duser.timezone=UTC","-Dfile.encoding=UTF-8","-XX:+ExitOnOutOfMemoryError","-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager","--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED","--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED","--add-opens=java.base/java.nio=ALL-UNNAMED","--add-opens=java.base/sun.nio.ch=ALL-UNNAMED","--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED","--add-opens=java.base/java.io=ALL-UNNAMED","--add-opens=java.base/java.lang=ALL-UNNAMED","--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"]
Copy link
Member

Choose a reason for hiding this comment

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

i wonder if we should modify the code to always append these options for java > 8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bin/run-java does that, so it does happen if you set druid.indexer.runner.javaCommand=bin/run-java (which the default configs do). Having the ForkingTaskRunner do it also seems legit though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified ForkingTaskRunner in this way and updated the main PR description.

@gianm gianm added this to the 27.0 milestone Jun 28, 2023
@gianm
Copy link
Contributor Author

gianm commented Jun 29, 2023

I was using java 17 with no issue for quite some time in most of my local development until fairly recently where I have switched to java 20 (which has some dependency problems for some tests such as the equalsverifier stuff which maybe needs to be updated to be cool).

Well, Java 20 will be next 🙂

@gianm
Copy link
Contributor Author

gianm commented Jun 29, 2023

Raised #14502 for Java 21.

@gianm gianm merged commit 63ee69b into apache:master Jul 7, 2023
@gianm gianm deleted the j17-ok branch July 7, 2023 20:07
sergioferragut pushed a commit to sergioferragut/druid that referenced this pull request Jul 21, 2023
* Claim full support for Java 17.

No production code has changed, except the startup scripts.

Changes:

1) Allow Java 17 without DRUID_SKIP_JAVA_CHECK.

2) Include the full list of opens and exports on both Java 11 and 17.

3) Document that Java 17 is both supported and preferred.

4) Switch some tests from Java 11 to 17 to get better coverage on the
   preferred version.

* Doc update.

* Update errorprone.

* Update docker_build_containers.sh.

* Update errorprone in licenses.yaml.

* Add some more run-javas.

* Additional run-javas.

* Update errorprone.

* Suppress new errorprone error.

* Add exports and opens in ForkingTaskRunner for Java 11+.

Test, doc changes.

* Additional errorprone updates.

* Update for errorprone.

* Restore old fomatting in LdapCredentialsValidator.

* Copy bin/ too.

* Fix Java 15, 17 build line in docker_build_containers.sh.

* Update busybox image.

* One more java command.

* Fix interpolation.

* IT commandline refinements.

* Switch to busybox 1.34.1-glibc.

* POM adjustments, build and test one IT on 17.

* Additional debugging.

* Fix silly thing.

* Adjust command line.

* Add exports and opens one more place.

* Additional harmonization of strong encapsulation parameters.
@maytasm
Copy link
Contributor

maytasm commented Aug 4, 2023

@gianm Do we need to update java.version, maven.compiler.source and maven.compiler.target to Java 17?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java 17 compatibility
3 participants