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

Fixes #12171 - QoSHandler does not resume on a virtual thread. #12174

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Aug 19, 2024

Now QoSHandler attempts to resume using a virtual thread if the request was handled with a virtual thread and then suspended.

Removed warn() from VirtualThreads.isVirtualThread(), it was too verbose.

@sbordet sbordet requested a review from gregw August 19, 2024 12:52
@sbordet sbordet linked an issue Aug 19, 2024 that may be closed by this pull request
Comment on lines 365 to 410
private void execute(Runnable task, boolean useVirtualThreads)
{
ThreadPool executor = getServer().getThreadPool();
if (useVirtualThreads)
{
Executor virtualExecutor = VirtualThreads.getVirtualThreadsExecutor(executor);
if (virtualExecutor != null)
{
virtualExecutor.execute(task);
return;
}
}
executor.execute(task);
}
Copy link
Contributor

@gregw gregw Aug 19, 2024

Choose a reason for hiding this comment

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

I don't think we should do specific QoSHandler resolution for this. See my comments on #12171.... but tl;dr; is that we can't be putting this logic everywhere in the code base that getThreadPool().execute(entry) is used. We need either to not care, or have a general solution.

@sbordet sbordet requested a review from gregw August 22, 2024 09:48
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

See 5bbae27. These tests were broken in head, so as they are related to this PR, I have disabled and we can fix them here.

@gregw
Copy link
Contributor

gregw commented Aug 26, 2024

Sorry @sbordet I just screwed this branch... let's see if I can fix it...

@gregw gregw force-pushed the fix/jetty-12.0.x/qos-handler-virtual-threads branch from 48e0e41 to c0d5adf Compare August 26, 2024 04:00
@gregw
Copy link
Contributor

gregw commented Aug 26, 2024

Sorry @sbordet I just screwed this branch... let's see if I can fix it...

OK I reverted my merge. I didn't see that this is for 12.0.x, and merged with 12.1.x to get the disabled tests from 5bbae27.
Probably best not to fix here. I'll look at 12.1.x head to see if I can work out why they are failing.

@sbordet
Copy link
Contributor Author

sbordet commented Aug 26, 2024

@gregw the failures in HEAD were unrelated to this PR.

It is not fixed yet by your revert, as it still shows 3000+ files changed.

I'll force push my original work.

@sbordet sbordet force-pushed the fix/jetty-12.0.x/qos-handler-virtual-threads branch from c0d5adf to e58bc60 Compare August 26, 2024 09:56
Now QoSHandler attempts to resume using a virtual thread if the request was handled with a virtual thread and then suspended.

Removed warn() from VirtualThreads.isVirtualThread(), it was too verbose.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet force-pushed the fix/jetty-12.0.x/qos-handler-virtual-threads branch from e58bc60 to e560b77 Compare August 26, 2024 10:02
@sbordet sbordet requested a review from gregw August 26, 2024 10:04
@gregw
Copy link
Contributor

gregw commented Aug 27, 2024

@gregw the failures in HEAD were unrelated to this PR.

Yeah I know. But I thought this PR would have to pass those tests, so I thought they could be fixed here... but I didn't see the 12.0 vs 12.1 thing... oops

It is not fixed yet by your revert, as it still shows 3000+ files changed.

Dang! Sorry I thought I forced pushed it back.

@sbordet sbordet merged commit 0420e92 into jetty-12.0.x Aug 27, 2024
6 of 10 checks passed
@sbordet sbordet deleted the fix/jetty-12.0.x/qos-handler-virtual-threads branch August 27, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

QoSHandler does not resume on a virtual thread
2 participants