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

Adapt ConcurrencyThrottleSupport to use ReentrantLock for better virtual thread support #32251

Closed
philwebb opened this issue Feb 12, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

See spring-projects/spring-boot#39529, specifically:

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 that ConcurrencyThrottleSupport, 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 to ReentrantLock would mitigate that?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 12, 2024
@jhoeller jhoeller self-assigned this Feb 13, 2024
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 13, 2024
@jhoeller jhoeller added this to the 6.1.4 milestone Feb 13, 2024
@snicoll snicoll changed the title Consider if ConcurrencyThrottleSupport should use ReentrantLock for better virtual thread support Adapt ConcurrencyThrottleSupport to use ReentrantLock for better virtual thread support Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants