Skip to content

chore(deps): upgrade protobuf-java to 4.35.0 - #362

Closed
korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
grafana:mainfrom
korniltsev-grafanista-yolo-vibecoder239:upgrade-protobuf-latest
Closed

korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
grafana:mainfrom
korniltsev-grafanista-yolo-vibecoder239:upgrade-protobuf-latest

Conversation

@korniltsev-grafanista-yolo-vibecoder239

Copy link
Copy Markdown
Contributor

Bumps the vendored protobuf runtime from 4.33.5 to 4.35.0, the latest release on Maven Central (4.34.2 is a patch on the older 4.34 line).

Related to #361.

Why 4.35.0 is safe here

  • Java 8 target preserved — the 4.35.0 jar is still compiled to class file major version 52 and declares osgi.ee=JavaSE 1.8, matching the agent's sourceCompatibility/targetCompatibility = 1.8.
  • No new transitive dependencies — protobuf-java 4.35.0 has an empty <dependencies> block, so the shaded pyroscope.jar gains nothing else.
  • Checked-in gencode stays valid — agent/src/main/java/io/pyroscope/labels/pb/JfrLabels.java is generated by protoc 4.26.1 and RuntimeVersion only 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$MemoryAccessor in 4.35.0 still calls sun.misc.Unsafe::arrayBaseOffset when the JDK allows it (the default --sun-misc-unsafe-memory-access=warn on JDK 25).

What 4.35.0 does add is a graceful fallback: if sun.misc.Unsafe is 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 test and the Java 8/11/17/21 build matrix.

🤖 Generated with Claude Code

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>
@korniltsev-grafanista

Copy link
Copy Markdown
Contributor

#363

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.

2 participants