Safepoint metrics no longer return warnings#989
Conversation
Still cross-jvm compatible due to usage of inner class.
Generate changelog in
|
|
I've begun the process of unblocking a proper fix via module-info: |
|
@carterkozak your conclusion was that this does not in fact unblock a proper fix, right? |
|
I don't think there's a proper way to access safepoint time in jdk9+ without warnings, and 16+ will throw unless we specify |
|
This branch doesn't appear to resolve the problem on jdk16, however it does avoid illegal reflective access warnings on older builds. |
|
I think this PR has the right idea, but instead of using byte-buddy to generate non-reflective accesses we should use java8 javac. Setup will be a little odd, so I'd propose a new project which publishes a jar with a minimal API around accessing We use the safepoint time internally in our server project, so it will be helpful to share the extraction code instead of duplicating it. Thoughts? |
|
@carterkozak curious which JRE compatibility versions you're thinking about targeting. Would we still target a JRE 8 for now? Would we create a multi-release JAR with JRE 8 and 9+ (with proper module-info declarations) classes? |
|
I haven’t been able to get module-info to work at all when encapsulation is enforced because the sun packages are not exposed. When we need module-info definitions we’ll have to decide between bumping the minimum version to java 11, or multi-release jars. I hope that by the time it’s necessary we’ll be able to safely require java 11, mr jars are difficult to test. I can build a jar using java 8 which references the classes without reflection and it resolves the reflective access warnings, however java 16 still fails. |
|
@carterkozak maybe an easier fix is to have bytebuddy generate java 8 bytecode? |
|
I think we can close this out now that #999 has merged, now we use java 8 bytecode from https://github.com/palantir/jvm-diagnostics |
|
Closing, this has been resolved |
Still cross-jvm compatible due to usage of inner class. Generally this is a bit heinous as a tactic, though I don't really see a better way without hacks. Java won't let us compile against the code with our javac settings, while using reflection directly will trigger the detection mechanisms.