Bump grpc-java to 1.81.0 to silence Java 25 Unsafe deprecation warning#873
Merged
ahmedmuhsin merged 4 commits intoJun 3, 2026
Merged
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.
ahmedmuhsin
requested review from
TsuyoshiUshio,
gavin-aguiar,
hallvictoria,
swapnil-nagar and
vrdmr
as code owners
May 15, 2026 01:16
…unctions-java-worker into fix/grpc-netty-shaded-bump-java25
gavin-aguiar
previously approved these changes
May 19, 2026
| <mockito-core.version>4.11.0</mockito-core.version> | ||
| <appinsights.agents.version>3.7.6</appinsights.agents.version> | ||
| <grpc.version>1.75.0</grpc.version> | ||
| <grpc.version>1.81.0</grpc.version> |
Contributor
There was a problem hiding this comment.
Do you also need to update protobuf to a compatible version?
Bumps protobuf-java (and the matching protoc artifact used by protobuf-maven-plugin) from 3.25.5 to 3.25.8. Same minor (3.25.x), patch-level fixes only, fully compatible with grpc-protobuf 1.81.0 which declares 3.25.5 as the minimum.
Collaborator
Author
|
@gavin-aguiar Good call. |
gavin-aguiar
approved these changes
Jun 3, 2026
ahmedmuhsin
added a commit
that referenced
this pull request
Jul 24, 2026
#873) * Bump grpc-java to 1.81.0 to silence Java 25 Unsafe deprecation warning 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. * Bump protobuf-java and protoc to 3.25.8 Bumps protobuf-java (and the matching protoc artifact used by protobuf-maven-plugin) from 3.25.5 to 3.25.8. Same minor (3.25.x), patch-level fixes only, fully compatible with grpc-protobuf 1.81.0 which declares 3.25.5 as the minimum.
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.