Author: markt
Date: Thu May 10 21:07:22 2012
New Revision: 1336884

URL: http://svn.apache.org/viewvc?rev=1336884&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53063
When using an Executor with BIO, use the executor's maxThreads as the default 
for maxConnections

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/webapps/docs/config/ajp.xml
    tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1336884&r1=1336883&r2=1336884&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Thu May 
10 21:07:22 2012
@@ -305,7 +305,10 @@ public abstract class AbstractEndpoint {
         }
     }
     public int getMaxThreads() {
-        if (running && executor!=null) {
+        return getMaxThreadsExecutor(running);
+    }
+    protected int getMaxThreadsExecutor(boolean useExecutor) {
+        if (useExecutor && executor != null) {
             if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
                 return 
((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize();
             } else if (executor instanceof ResizableExecutor) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1336884&r1=1336883&r2=1336884&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Thu May 10 
21:07:22 2012
@@ -376,7 +376,7 @@ public class JIoEndpoint extends Abstrac
         // Initialize maxConnections
         if (getMaxConnections() == 0) {
             // User hasn't set a value - use the default
-            setMaxConnections(getMaxThreads());
+            setMaxConnections(getMaxThreadsExecutor(true));
         }
 
         if (serverSocketFactory == null) {

Modified: tomcat/trunk/webapps/docs/config/ajp.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=1336884&r1=1336883&r2=1336884&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/ajp.xml (original)
+++ tomcat/trunk/webapps/docs/config/ajp.xml Thu May 10 21:07:22 2012
@@ -345,7 +345,9 @@
       falls below this value. The operating system may still accept
       connections based on the <code>acceptCount</code> setting. Default value
       varies by connector type. For BIO the default is the value of
-      <strong>maxThreads</strong>. For NIO the default is <code>10000</code>.
+      <strong>maxThreads</strong> unless an <a 
href="executir.html">Executor</a>
+      is used in which case the default will be the value of maxThreads from 
the
+      executor. For NIO the default is <code>10000</code>.
       For APR/native, the default is <code>8192</code>.</p>
       <p>Note that for APR/native on Windows, the configured value will be
       reduced to the highest multiple of 1024 that is less than or equal to

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1336884&r1=1336883&r2=1336884&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Thu May 10 21:07:22 2012
@@ -380,7 +380,9 @@
       falls below this value. The operating system may still accept
       connections based on the <code>acceptCount</code> setting. Default value
       varies by connector type. For BIO the default is the value of
-      <strong>maxThreads</strong>. For NIO the default is <code>10000</code>.
+      <strong>maxThreads</strong> unless an <a 
href="executir.html">Executor</a>
+      is used in which case the default will be the value of maxThreads from 
the
+      executor. For NIO the default is <code>10000</code>.
       For APR/native, the default is <code>8192</code>.</p>
       <p>Note that for APR/native on Windows, the configured value will be
       reduced to the highest multiple of 1024 that is less than or equal to



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

Reply via email to