question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NR agent fails on IBM Semeru Runtimes

See original GitHub issue

Is your feature request related to a problem? Please describe.

Ref discussion here: https://discuss.newrelic.com/t/feature-idea-java-new-relic-agent-doesnt-work-with-openj9-17/170671

When IBM Semeru Runtimes Java 11 recently changed its java.vendor string to “IBM Corporation”, the NR Java agent seems to have stopped working and apparently never supported Java 17 or any other recent IBM Java release. When I asked for more details about why the vendor string mattered, I was pointed at this repo to investigate for myself.

I discovered that the AttachLifecycleObserver is disabled for any JVM that sets java.vendor = "IBM Corporation" which includes all Semeru Runtimes (Open and Certified Edition) as well as IBM’s older IBM SDK for Java 7, 7.1, and 8. There isn’t any reasoning for it in the code, that I could find. I’m suspicious that the reason this change was made is no longer relevant.

Since the NR agent worked just fine for Java 11 before we changed the java.vendor string and the Eclipse OpenJ9 JVM built into IBM Semeru Runtimes uses the same source code across all Java releases (8,11,17,18), I think the NR agent should just work. That probably includes the IBM SDK for Java 8 (which also uses the Eclipse OpenJ9 JVM).

Feature Description

I believe all that’s needed is to remove isAgentSafe() from the AttachLifecycleObserver class. I have a pull request ready to go if the project would like me to submit it.

Describe Alternatives

A clear and concise description of any alternative solutions or features you’ve considered. Are there examples you could link us to?

(migrate to Jira)

Additional context

IBM Semeru Runtimes are the same binaries as used to be built by the AdoptOpenJDK community as “OpenJDK with Eclipse OpenJ9”. When AdoptOpenJDK moved to the Eclipse Foundation, they were prevented (by contract with Oracle) from continuing to produce the OpenJDK with OpenJ9 binaries. IBM stepped forward at the time and has produced the same binaries under the name “IBM Semeru Runtimes”: built with open source components and the binaries are available at no cost for everyone to use. As chief architect for IBM Java and Semeru Runtimes, I would love to see New Relic agents working smoothly with Semeru Runtimes for all our Java releases.

Priority

Really Want. We have customers who have been happily using NR with Semeru Runtimes 11 who are now broken and, while we have a workaround that involves an agent that mashes back the older java.vendor setting, it’s a super hack.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
tbradelliscommented, Oct 25, 2022

@bogdanbrindusan and @mstoodle I’ve removed the IBM workaround logic. We were unable to test as fully as we’d liked. Gradle seems to have trouble with downloading IBM Semeru builds. We hoped to get our full suites running. I could tell in some of my tests that there are some special cases I’ll need to address in our integration tests. Not being able to download them locally with gradle made it really cumbersome to step through.

At any rate, this is going into our 7.11 release. There’s a snapshot build linked below. If you are able to run this agent and provide any feedback it would be greatly appreciated, even if a simple smoke test to confirm you don’t hit any issues. https://github.com/newrelic/newrelic-java-agent/suites/8940160106/artifacts/410261834

Thanks again for bringing this to our attention.

2reactions
mstoodlecommented, Jun 15, 2022

Thanks for the update, @kford-newrelic .

For the record, the change needed is very minimal from a coding perspective (See https://github.com/newrelic/newrelic-java-agent/compare/main...mstoodle:ibmjava-changes). But I can understand if you’ll want to introduce some additional testing on the free Semeru Runtimes binaries (available here: https://ibm.com/semeru-runtimes/downloads) that it would enable you to support, and that may be effort you aren’t willing to commit to in the next quarter.

It is a shame, though, that all those Fortune 500 and other companies that rely on Semeru Runtimes to run their businesses can’t use your product in the meantime. I guess not many of them are complaining about it, which means it could represent an untapped market segment for you… I would love to tell all of them how well New Relic “now” works out of the box with IBM Semeru Runtimes 😃 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Java] New Relic agent doesn't work with OpenJ9 17
Hi, I cannot use NewRelic agent 7.4.1 with latest OpenJ9 JDK 17 (docker image ibm-semeru-runtimes:open-17-jdk) Can you, please, fix it as NewRelic agent...
Read more >
IBM Semeru Runtimes fixes
Fixes, new function, restrictions, and documentation for the IBM Semeru Runtimes.
Read more >
Semeru Runtimes getting started - IBM
Information to help you get started with the IBM® Semeru Runtimes.
Read more >
Troubleshooting OpenJ9 and IBM J9 JVMs
On POSIX operating systems, by default, the command kill -3 ${PID} will request a thread dump. For Semeru Java, use jcmd: jcmd $PID...
Read more >
Semeru Runtimes migration guide - IBM
The HealthCenter agent that is available in earlier releases is no longer included. The following codepages that were provided in IBM SDK, Java ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found