Repository navigation
chore(deps): upgrade protobuf-java to 4.35.0 - #362
Closed
korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
Closed
korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
Conversation
Bumps the protobuf-java runtime from 4.33.5 to the latest release, 4.35.0. 4.35.0 gracefully falls back to a non-Unsafe memory accessor when sun.misc.Unsafe is present but configured to throw, which keeps the agent working on JDKs that restrict sun.misc.Unsafe memory access (JEP 498). The jar still targets Java 8 bytecode (class file major version 52) and has no transitive dependencies, and the checked-in gencode (4.26.1) stays within the same major version, so it remains compatible with the new runtime. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
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.
Bumps the vendored protobuf runtime from
4.33.5to4.35.0, the latest release on Maven Central (4.34.2is a patch on the older 4.34 line).Related to #361.
Why 4.35.0 is safe here
osgi.ee=JavaSE 1.8, matching the agent'ssourceCompatibility/targetCompatibility = 1.8.protobuf-java4.35.0 has an empty<dependencies>block, so the shadedpyroscope.jargains nothing else.agent/src/main/java/io/pyroscope/labels/pb/JfrLabels.javais generated by protoc 4.26.1 andRuntimeVersiononly rejects gencode from a different major version or newer than the runtime; 4.26.1 gencode on a 4.35.0 runtime satisfies both.Relation to #361
This does not silence the JDK 25 warning in #361:
UnsafeUtil$MemoryAccessorin 4.35.0 still callssun.misc.Unsafe::arrayBaseOffsetwhen the JDK allows it (the default--sun-misc-unsafe-memory-access=warnon JDK 25).What 4.35.0 does add is a graceful fallback: if
sun.misc.Unsafeis present but configured to throw (=deny, and presumably the future default), protobuf now catches that and continues with a non-Unsafe memory accessor at slightly reduced performance instead of failing, and logs that "a later Protobuf version release will stop using sun.misc.Unsafe entirely". So this upgrade removes the "agent breaks completely" outcome described in the issue, and the warning itself will go away with a future protobuf release.Testing
I could not build locally (no JDK in my environment) — relying on CI for
./gradlew testand the Java 8/11/17/21 build matrix.🤖 Generated with Claude Code