Skip to content

Commit 01c85b1

Browse files
committed
Add explicit note on blocking in case of concurrency limit
Closes gh-33873
1 parent df376d9 commit 01c85b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java

+5
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ public void setTaskTerminationTimeout(long timeout) {
196196
* The default of -1 indicates no concurrency limit at all.
197197
* <p>This is the equivalent of a maximum pool size in a thread pool,
198198
* preventing temporary overload of the thread management system.
199+
* However, in contrast to a thread pool with a managed task queue,
200+
* this executor will block the submitter until the task can be
201+
* accepted when the configured concurrency limit has been reached.
202+
* If you prefer queue-based task hand-offs without such blocking,
203+
* consider using a {@code ThreadPoolTaskExecutor} instead.
199204
* @see #UNBOUNDED_CONCURRENCY
200205
* @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor#setMaxPoolSize
201206
*/

0 commit comments

Comments
 (0)