Skip to content

Enable Netty and BookKeeper IO optimizations on jdk17#3234

Merged
merlimat merged 2 commits intoapache:masterfrom
nicoloboschi:enable-netty-and-native-bk
May 11, 2022
Merged

Enable Netty and BookKeeper IO optimizations on jdk17#3234
merlimat merged 2 commits intoapache:masterfrom
nicoloboschi:enable-netty-and-native-bk

Conversation

@nicoloboschi
Copy link
Contributor

Motivation

Starting from JDK17 the reflection is not allowed in the jdk internals modules. Until JDK16, it will print a warning like this:

Error:  WARNING: An illegal reflective access operation has occurred
Error:  WARNING: Illegal reflective access by org.apache.bookkeeper.proto.checksum.DirectMemoryCRC32Digest (file:/home/runner/work/bookkeeper/bookkeeper/bookkeeper-server/target/classes/) to method java.util.zip.CRC32.updateByteBuffer(int,long,int,int)
Error:  WARNING: Please consider reporting this to the maintainers of org.apache.bookkeeper.proto.checksum.DirectMemoryCRC32Digest
Error:  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
Error:  WARNING: All illegal access operations will be denied in a future release

With JDK17, BookKeeper and Netty work well even if this optimization are not allowed. In order to continue to use them, we need to open the required modules

For Netty, we can follow this issue: netty/netty#12265
For BookKeeper, I identified DirectMemoryCRC32Digest and NativeIO classes

Changes

  • Add the open modules options to open the required module (only if jdk9+ because jdk8 doesn't know the --add-opens instruction

@nicoloboschi
Copy link
Contributor Author

rerun failure checks

@hezhangjian
Copy link
Member

image
image
I suggest that we'd better keep the script consistent.

Copy link
Contributor

@lordcheng10 lordcheng10 left a comment

Choose a reason for hiding this comment

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

LGTM

@merlimat merlimat merged commit 78662ac into apache:master May 11, 2022
@hangc0276 hangc0276 added this to the 4.16.0 milestone Oct 14, 2022
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
* Enable netty optimization and BK native IO on jdk17

* zip and better docs
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.

6 participants