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:09:56 UTC

[tomcat] 02/03: Improve comment

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6590a3c3cd3044e531c6ba946c9d19ee463cb2d0
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 f5b9b69..b6d5105 100644
--- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
+++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
@@ -153,6 +153,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();
                 if (!queue.force(command)) {
                     submittedCount.decrementAndGet();

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org