Bump grpc-java to 1.81.0 to silence Java 25 Unsafe deprecation warning#873
Open
ahmedmuhsin wants to merge 1 commit into
Open
Bump grpc-java to 1.81.0 to silence Java 25 Unsafe deprecation warning#873ahmedmuhsin wants to merge 1 commit into
ahmedmuhsin wants to merge 1 commit into
Conversation
Bumps io.grpc:grpc-netty-shaded (and grpc-protobuf, grpc-stub, protoc-gen-grpc-java) from 1.75.0 to 1.81.0, which pulls in shaded Netty 4.1.132. The previous shaded Netty (4.1.118 inside grpc-java 1.75.0) called the now terminally-deprecated sun.misc.Unsafe::allocateMemory, producing noisy warnings on JDK 23+ (and especially JDK 25). Netty 4.1.124+ routes direct-buffer allocation away from the deprecated method, so the warning goes away without any code or launch-argument changes. grpc-java 1.81.0 still targets Java 8 bytecode (animal-sniffer is still on the dependency tree), so this preserves Java 8 compatibility for the worker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Running the worker on Java 25 produces these warnings on startup:
The warning comes from the shaded Netty inside
grpc-netty-shaded(Netty4.1.118.Finalships insidegrpc-java 1.75.0). Netty 4.1.x calls the now terminally-deprecatedsun.misc.Unsafe::allocateMemoryfor direct-buffer allocation; JDK 23+ flagged that method, and JDK 25 prints the warning on startup.What
Bumps
grpc.versionfrom1.75.0→1.81.0(latest stable). That pulls in shaded Netty4.1.132.Final, which routes direct-buffer allocation away from the deprecated method, so the warning disappears with no code or launch-argument changes.Java 8 compatibility
grpc-java 1.81.0still targets Java 8 bytecode and ships withanimal-snifferchecks intact (visible in the dependency tree), so this keeps the worker compatible with the full Java 8 → 25 range we support.Verification
mvn clean package -DskipTestssucceeds; uber-jar correctly bundlesgrpc-*-1.81.0andgrpc-netty-shaded-1.81.0.mvn test: 63/63 tests pass, no regressions.sun.misc.Unsafe::allocateMemorywarning no longer appears.