Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pid instrumentation on Eclipse J9 #297

Merged
merged 2 commits into from
Dec 18, 2020
Merged

Fix pid instrumentation on Eclipse J9 #297

merged 2 commits into from
Dec 18, 2020

Conversation

wolfs
Copy link
Member

@wolfs wolfs commented Nov 30, 2020

Use the ProcessHandle API when available instead of using the proprietary MXBean. This should fix the PID instrumentation when using Eclipse J9 JVM.

Fixes #294

@wolfs wolfs added this to the 0.16.0 milestone Nov 30, 2020
@wolfs wolfs self-assigned this Nov 30, 2020
@wolfs wolfs marked this pull request as draft November 30, 2020 18:13
@wolfs wolfs added the bug label Nov 30, 2020
@wolfs wolfs marked this pull request as ready for review December 18, 2020 14:41
@wolfs wolfs requested a review from lptr December 18, 2020 14:41
Copy link
Member

@lptr lptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left one comment about a comment.

protected Long getPid() {
try {
// With Gradle 6.6 we can't inject `ProcessEnvironment`, so that is why we access the runtime MXBean here.
// On Java 9 we could use the nicer ProcessHandle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not "could" anymore. Maybe also point to PidCollectorBuildService from here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I adjusted the comment.

@wolfs wolfs merged commit 0abc00f into master Dec 18, 2020
@wolfs wolfs deleted the wolfs/support-j9 branch December 18, 2020 17:14
@gradle gradle deleted a comment May 25, 2021
@gradle gradle deleted a comment May 25, 2021
@gradle gradle deleted a comment May 25, 2021
@gradle gradle deleted a comment May 25, 2021
@gradle gradle deleted a comment May 25, 2021
@gradle gradle deleted a comment May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caused by: java.lang.NoSuchFieldException: jvm
2 participants