You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/07/21 16:15:23 UTC
[tomcat] 01/02: Improve comment
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 4afe23a16e55eeec43daa2037778029774c6f633
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jul 21 17:05:19 2021 +0100
Improve comment
---
java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
index 2b9e931..3038baa 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -176,6 +176,10 @@ public class ThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor
super.execute(command);
} catch (RejectedExecutionException rx) {
if (super.getQueue() instanceof TaskQueue) {
+ // If the Executor is close to maximum pool size, concurrent
+ // calls to execute() may result (due to Tomcat's use of
+ // TaskQueue) in some tasks being rejected rather than queued.
+ // If this happens, add them to the queue.
final TaskQueue queue = (TaskQueue)super.getQueue();
try {
if (!queue.force(command, timeout, unit)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org