tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r811089 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/tomcat/util/net/AprEndpoint.java java/org/apache/tomcat/util/net/JIoEndpoint.java java/org/apache/tomcat/util/net/NioEndpoint.java webapps/docs/changelog.xml
Date Thu, 03 Sep 2009 19:40:45 GMT
Author: fhanik
Date: Thu Sep  3 19:40:44 2009
New Revision: 811089

URL: http://svn.apache.org/viewvc?rev=811089&view=rev
Log:
dont report thread count unless the connector is actually managing the threads.. ie if an
external executor is used

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=811089&r1=811088&r2=811089&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Sep  3 19:40:44 2009
@@ -80,12 +80,6 @@
   -0: kkolinko: http://marc.info/?l=tomcat-dev&m=124192105131636&w=2
   -1:
 
-* Dont try to report thread counts when using an executor from outside
-  http://people.apache.org/~fhanik/connector-thread-report.patch
-  +1: fhanik, kkolinko,funkman
-  +1: markt - would 0 make more sense rather than -1? Happy with either
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47369.
   http://svn.apache.org/viewvc?rev=784879&view=rev
   +1: fhanik, markt, mturk, rjung

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=811089&r1=811088&r2=811089&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Thu Sep  3 19:40:44
2009
@@ -539,17 +539,24 @@
      * @return the amount of threads that are managed by the pool
      */
     public int getCurrentThreadCount() {
-        return curThreads;
+        if (executor!=null) {
+            return -1;
+        } else {
+            return curThreads;
+        }
     }
 
-
     /**
-     * Return the amount of threads currently busy.
+     * Return the amount of threads that are in use 
      *
-     * @return the amount of threads currently busy
+     * @return the amount of threads that are in use
      */
     public int getCurrentThreadsBusy() {
-        return curThreadsBusy;
+        if (executor!=null) {
+            return -1;
+        } else {
+            return workers!=null?curThreads - workers.size():0;
+        }
     }
 
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=811089&r1=811088&r2=811089&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Thu Sep  3 19:40:44
2009
@@ -263,12 +263,30 @@
         return paused;
     }
     
+    /**
+     * Return the amount of threads that are managed by the pool.
+     *
+     * @return the amount of threads that are managed by the pool
+     */
     public int getCurrentThreadCount() {
-        return curThreads;
+        if (executor!=null) {
+            return -1;
+        } else {
+            return curThreads;
+        }
     }
-    
+
+    /**
+     * Return the amount of threads that are in use 
+     *
+     * @return the amount of threads that are in use
+     */
     public int getCurrentThreadsBusy() {
-        return workers!=null?curThreads - workers.size():0;
+        if (executor!=null) {
+            return -1;
+        } else {
+            return workers!=null?curThreads - workers.size():0;
+        }
     }
     
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=811089&r1=811088&r2=811089&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Thu Sep  3 19:40:44
2009
@@ -728,20 +728,34 @@
      * @return the amount of threads that are managed by the pool
      */
     public int getCurrentThreadCount() {
-        return curThreads;
+        if (executor!=null) {
+            if (executor instanceof ThreadPoolExecutor) {
+                return ((ThreadPoolExecutor)executor).getPoolSize();
+            } else {
+                return -1;
+            }
+        } else {
+            return curThreads;
+        }
     }
 
-
     /**
-     * Return the amount of threads currently busy.
+     * Return the amount of threads that are in use 
      *
-     * @return the amount of threads currently busy
+     * @return the amount of threads that are in use
      */
     public int getCurrentThreadsBusy() {
-        return curThreadsBusy;
+        if (executor!=null) {
+            if (executor instanceof ThreadPoolExecutor) {
+                return ((ThreadPoolExecutor)executor).getActiveCount();
+            } else {
+                return -1;
+            }
+        } else {
+            return workers!=null?curThreads - workers.size():0;
+        }
     }
 
-
     /**
      * Return the state of the endpoint.
      *

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=811089&r1=811088&r2=811089&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Sep  3 19:40:44 2009
@@ -155,6 +155,7 @@
   </subsection>
   <subsection name="Coyote">
     <changelog>
+      <update>Dont report thread count from connector if an external executor is used.</update>

       <fix>
         <bug>39637</bug>: Enable the AJP connectors to correctly handle client
         certificate chains. Patch by Patrik Schnellmann. (markt)



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


Mime
View raw message