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

Java 17 compatibility #12838

Closed
gianm opened this issue Jul 30, 2022 · 5 comments · Fixed by #14384
Closed

Java 17 compatibility #12838

gianm opened this issue Jul 30, 2022 · 5 comments · Fixed by #14384

Comments

@gianm
Copy link
Contributor

gianm commented Jul 30, 2022

Java 17 is the current LTS release. We'd like to officially support this.

@gianm
Copy link
Contributor Author

gianm commented Jul 30, 2022

Some things we'll need to tackle:

  1. Strong encapsulation in Java 17 means that Druid requires various --add-opens and --add-exports parameters in order to function. Skipping these parameters leads to errors on startup, or, worse, an unstable experience. We need to provide these to the Java runtime without users having to explicitly configure them.
  2. DataSketches Memory does not currently support Java 14+ for all functionality. We use this both directly and via individual DataSketches. One specific incompatibility that I've noticed is memory-mapping files larger than 2GB in FrameFile. The unit tests explicitly skip this on Java 15: see FrameTestUtil#jdkCanDataSketchesMemoryMap. There may be other places as well.
  3. Run unit and integration tests on Java 17. (We can stop running in Java 15 when we do this; Java 15 isn't an LTS so there isn't much need to test both.)

@xvrl
Copy link
Member

xvrl commented Aug 2, 2022

some related work that was already merged in support of this #12341 #12351 #12282 #12306

Upgrading Netty – while possibly not required – would be a nice to have, since Netty 3 does't officially support Java 17 AFAIK #12032

@gianm
Copy link
Contributor Author

gianm commented Aug 10, 2022

Patch #12839 adds the relevant strong-encapsulation-related parameters to the command line when the Java version is >= 17, and updates the unit tests to run on Java 17 instead of 15.

@gianm
Copy link
Contributor Author

gianm commented Aug 27, 2022

#12987 dodges the incompatibility between DataSketches Memory and JDK17. After speaking with the DataSketches team I learned it's safe to use the current version of DataSketches (and future 8+11 compatible versions) as long as we avoid allocations or memory maps using Memory.map, WritableMemory.map, and WritableMemory.allocateDirect.

@gianm
Copy link
Contributor Author

gianm commented Dec 5, 2022

#12990 updated the docs to say that Java 17 is experimental.

As of now I am not aware of anything that is broken on Java 17. I use it on my dev machine and we have it running in various production clusters. I'd like to be able to start recommending it fully soon.

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

Successfully merging a pull request may close this issue.

2 participants