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

(0.47) Destroy virtual thread data after VirtualThreadEnd callback #19874

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

thallium
Copy link
Contributor

@thallium thallium commented Jul 18, 2024

Currently destroyThreadData() is hooked onto the VirtualThreadEnd event which is called before the event callback. In JDWP, the agent uses TLS to associate nodes in the running thread list. Clearing TLS before the event callback makes the agent lose track of the node thus failed to remove existed virtual threads from the list. This commit adds JVMTI VirtualThreadDestroy event which is triggered after VirtualThreadEnd and jvmtiHookVirtualThreadDestroy() is hooked onto VirtualThreadDestroy event.

Fixes:
ibmruntimes/Semeru-Runtimes#80 #19759

Back-porting from: #19855

Currently destroyThreadData() is hooked onto the VirtualThreadEnd event
which is called before the event callback. In JDWP, the agent uses TLS
to associate nodes in the running thread list. Clearing TLS before
the event callback makes the agent lose track of the node thus failed to
remove existed virtual threads from the list. This commit adds JVMTI
VirtualThreadDestroy event which is triggered after VirtualThreadEnd and
jvmtiHookVirtualThreadDestroy() is hooked onto VirtualThreadDestroy
event.

Fixes:
ibmruntimes/Semeru-Runtimes#80
eclipse-openj9#19759

Signed-off-by: Gengchen Tuo <[email protected]>
@thallium
Copy link
Contributor Author

@babsingh FYI

@babsingh
Copy link
Contributor

This PR also incorporates the changes from #19873.

@babsingh babsingh merged commit 1af39f5 into eclipse-openj9:v0.47.0-release Jul 18, 2024
2 checks passed
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