Skip to content

Doc: ThreadPoolTaskExecutor's defaults vs setting queueCapacity for common pool scenarios [SPR-16944] #21483

@spring-projects-issues

Description

@spring-projects-issues

Constantino Cronemberger opened SPR-16944 and commented

According to ThreadPoolExecutor Javadoc:

"If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full."

In the class ThreadPoolTaskExecutor the default values are: 1 for the corePoolSize and Integer.MAX_VALUE for maxPoolSize and queueCapacity.

This means that a second thread will be created only when we have MAX_VALUE elements in the queue. This is is not reasonable.

I think queueCapacity should not have a default value.


Issue Links:

Backported to: 4.3.19

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions