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

Add info contributor support for JDK 24's VirtualThreadSchedulerMXBean #43594

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

panic08
Copy link

@panic08 panic08 commented Dec 22, 2024

In this commit, for applications using Spring with JDK 24, I added support for viewing Virtual threads information in ProcessInfo using VirtualThreadSchedulerMXBean. The use of VirtualThreadSchedulerMXBean is done using reflection. If the current JDK version is less than 24, then we will return null, otherwise a class with all the required VirtualThreadsInfo information.

I also added a test checking if null is returned if the JDK version is less than 24.

There is also a point that bothers me, do you think we need an additional test to check the values of the VirtualThreadsInfo fields themselves or not?

Related to #43175

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 22, 2024
Copy link
Member

@philwebb philwebb left a comment

Choose a reason for hiding this comment

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

Thanks very much for the PR. I've added some review comments for your consideration.

@philwebb
Copy link
Member

do you think we need an additional test to check the values of the VirtualThreadsInfo fields themselves or not?

I think we could add something to the existing test just to check that we have sensible(ish) values.

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 23, 2024
@philwebb philwebb added this to the 3.5.x milestone Dec 23, 2024
@panic08 panic08 force-pushed the add-info-contributor-support-for-VirtualThreadSchedulerMXBean branch from 6edc540 to d898b44 Compare December 25, 2024 18:57
@panic08 panic08 requested a review from philwebb December 25, 2024 18:57
@panic08 panic08 force-pushed the add-info-contributor-support-for-VirtualThreadSchedulerMXBean branch from d898b44 to 1f1b9b8 Compare December 25, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants