jetty.project
jetty.project copied to clipboard
Issue#11353 - Default virtual thread executor should created named threads
Specify a ThreadFactory when setting up the default virtual thread executor so it creates named threads.
(issue #11353)
Tested the reflective logic in probeVirtualThreadExecutor against different JDK versions for compatibility reasons:
- 19 (preview) ✅
- 20 (preview) ✅
- 21 ✅
Likewise, it does not work on the previous versions (JDK 18 and below) as virtual threads were only introduced in JDK 19 (preview). For older JDKs, the behavior remains the same as before:
VirtualThreads#getDefaultVirtualThreadsExecutorreutrnsnullVirtualThreads#areSupportedreturnsfalse
Any changes to Jetty 12 must not fail / crash on JDK 17 as well (as that is our minimum JDK version). I see you put a big red ❌ on JDK 17 in your initial comment, so that makes me nervous, but the CI build is happy and green. So what did you do?
Any changes to Jetty 12 must not fail / crash on JDK 17 as well (as that is our minimum JDK version). I see you put a big red ❌ on JDK 17 in your initial comment, so that makes me nervous, but the CI build is happy and green. So what did you do?
This was in reference to Simon's comment here: https://github.com/jetty/jetty.project/issues/11353#issuecomment-1916364459
What I meant to say was that the reflective code fails (as expected) on JDK 17 because there was no support for virtual threads prior to JDK 19 (preview). The build passes successfully and so do all tests on both JDK 17 and 21.
I can see how the description can be confusing. I will update it accordingly.
Superseded by #11430