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

Closing a context should interrupt pending virtual thread tasks of this context #5344

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

vietj
Copy link
Member

@vietj vietj commented Oct 6, 2024

No description provided.

…tate.

Motivation:

The TaskQueue does not implement closeability, since now such queue can hold many suspended virtual thread tasks, we should provide a way to deal those threads (interrupt) when the context holding the queue is closed, e.g.  undeploying a verticle or closing a vertx instance.

Changes:

Implement a TaskQueue close method that returns the list of current thread being suspended. The context holding the queue can close the queue when the context close future is destroyed.
@vietj vietj added this to the 4.5.11 milestone Oct 6, 2024
@vietj vietj force-pushed the interrupt-suspended-virtual-threads-4.x branch 3 times, most recently from b4c1246 to 343bd88 Compare October 7, 2024 07:22
@vietj vietj force-pushed the interrupt-suspended-virtual-threads-4.x branch from 343bd88 to 21cfc78 Compare October 7, 2024 07:39
@vietj vietj marked this pull request as ready for review October 7, 2024 07:43
@vietj vietj self-assigned this Oct 7, 2024
@vietj vietj changed the title Interrupt suspended virtual threads 4.x Closing a context should interrupt pending virtual thread tasks of this context Oct 7, 2024
@vietj vietj linked an issue Oct 7, 2024 that may be closed by this pull request
@vietj vietj merged commit 3eeffa3 into 4.x Oct 7, 2024
7 checks passed
@vietj vietj deleted the interrupt-suspended-virtual-threads-4.x branch October 7, 2024 15:48
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.

Undeployed Virtual Thread verticles cause memory leaks and/or never stop
1 participant