-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Document that task executor pool size properties are ignored when using virtual threads #39529
Labels
status: superseded
An issue that has been superseded by another
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Feb 12, 2024
philwebb
changed the title
Virtual threads implicitly being used with synchronized, when limitting concurrency
Document that task executor pool size properties are ignored when using virtual threads.
Feb 12, 2024
philwebb
added
type: documentation
A documentation update
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Feb 12, 2024
Thanks @peacemaker123456. We'll use this issue for the documentation updates and I've opened spring-projects/spring-framework#32251 to see if Framework want to make changes to |
wanger26
added a commit
to wanger26/spring-boot
that referenced
this issue
Feb 20, 2024
spring-projects#39529 Signed-off-by: Jakob Wanger <[email protected]>
wanger26
added a commit
to wanger26/spring-boot
that referenced
this issue
Feb 20, 2024
spring-projects#39529 Signed-off-by: Jakob Wanger <[email protected]>
mhalbritter
changed the title
Document that task executor pool size properties are ignored when using virtual threads.
Document that task executor pool size properties are ignored when using virtual threads
Feb 20, 2024
Superseded by #39629. |
mhalbritter
added
status: superseded
An issue that has been superseded by another
and removed
type: documentation
A documentation update
labels
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello dear team,
I noticed, that setting
spring.threads.virtual.enabled
to true, will always lead to the usage ofSimpleAsyncTaskExecutor
, therefore ignoring the config settings affecting the pool size. Likely you chose to do that because pooling with virtual threads makes no sense, given the low overhead of virtual thread creation. Yet it's not clear enough without looking at the source codeTaskExecutorConfiguration
. So maybe docs could be clearer here.The only possibility to limit the amount of parallel tasks is therefore the
spring.task.execution.simple.concurrency-limit
property, which essentially behaves like a max pool size. The issue I see here, is thatConcurrencyThrottleSupport
, which is being used under the hood, uses the synchronized blocks which leads to thread pinning and might cause several issues with virtual threads. Maybe switching toReentrantLock
would mitigate that?The text was updated successfully, but these errors were encountered: