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 2014/06/05 21:57:35 UTC

svn commit: r1600743 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/WsServerContainer.java webapps/docs/changelog.xml webapps/docs/web-socket-howto.xml

Author: markt
Date: Thu Jun  5 19:57:35 2014
New Revision: 1600743

URL: http://svn.apache.org/r1600743
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56577
Better executor configuration.

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/web-socket-howto.xml

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1600743&r1=1600742&r2=1600743&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Thu Jun  5 19:57:35 2014
@@ -27,7 +27,7 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -119,7 +119,6 @@ public class WsServerContainer extends W
         }
         // Executor config
         int executorCoreSize = 0;
-        int executorMaxSize = 200;
         long executorKeepAliveTimeSeconds = 60;
         value = servletContext.getInitParameter(
                 Constants.EXECUTOR_CORE_SIZE_INIT_PARAM);
@@ -127,11 +126,6 @@ public class WsServerContainer extends W
             executorCoreSize = Integer.parseInt(value);
         }
         value = servletContext.getInitParameter(
-                Constants.EXECUTOR_MAX_SIZE_INIT_PARAM);
-        if (value != null) {
-            executorMaxSize = Integer.parseInt(value);
-        }
-        value = servletContext.getInitParameter(
                 Constants.EXECUTOR_KEEPALIVETIME_SECONDS_INIT_PARAM);
         if (value != null) {
             executorKeepAliveTimeSeconds = Long.parseLong(value);
@@ -161,8 +155,8 @@ public class WsServerContainer extends W
         WsThreadFactory wsThreadFactory = new WsThreadFactory(threadGroup);
 
         executorService = new ThreadPoolExecutor(executorCoreSize,
-                executorMaxSize, executorKeepAliveTimeSeconds, TimeUnit.SECONDS,
-                new LinkedBlockingQueue<Runnable>(), wsThreadFactory);
+                Integer.MAX_VALUE, executorKeepAliveTimeSeconds, TimeUnit.SECONDS,
+                new SynchronousQueue<Runnable>(), wsThreadFactory);
     }
 
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1600743&r1=1600742&r2=1600743&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun  5 19:57:35 2014
@@ -212,6 +212,10 @@
         behaviour for <code>Session.getRequestURI()</code> which may result in
         further changes. (markt)
       </fix>
+      <fix>
+        <bug>56577</bug>: Improve the executor configuration used for the
+        callbacks associated with asynchronous writes. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">

Modified: tomcat/trunk/webapps/docs/web-socket-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/web-socket-howto.xml?rev=1600743&r1=1600742&r2=1600743&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/web-socket-howto.xml (original)
+++ tomcat/trunk/webapps/docs/web-socket-howto.xml Thu Jun  5 19:57:35 2014
@@ -118,10 +118,9 @@ implement its own timeout mechanism to h
    <ul>
      <li><code>org.apache.tomcat.websocket.executorCoreSize</code>: The core
          size of the executor thread pool. If not set, the default of 0 (zero)
-         is used.</li>
-     <li><code>org.apache.tomcat.websocket.executorMaxSize</code>: The maximum
-         permitted size of the executor thread pool. If not set, the default of
-         200 is used.</li>
+         is used. Note that the maximum permitted size of the executor thread
+         pool is hard coded to <code>Integer.MAX_VALUE</code> which effectively
+         means it is unlimited.</li>
      <li><code>org.apache.tomcat.websocket.executorKeepAliveTimeSeconds</code>:
          The maximum time an idle thread will remain in the executor thread pool
          until it is terminated. If not specified, the default of 60 seconds is



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