You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2014/08/14 19:46:55 UTC

svn commit: r1618000 - in /tomcat/jk/trunk: native/common/jk_ajp_common.c xdocs/miscellaneous/changelog.xml

Author: rjung
Date: Thu Aug 14 17:46:55 2014
New Revision: 1618000

URL: http://svn.apache.org/r1618000
Log:
BZ 56703: Fix inflated counter for current number of
backend connections in status worker.

If an error occured during using a connection and the
connection was known to be already shut down by lower
level functions, the code to clean up did not decrement
the connection counter.

The most likely such situation was when a connection
timeout occured on the backend.

Modified:
    tomcat/jk/trunk/native/common/jk_ajp_common.c
    tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1618000&r1=1617999&r2=1618000&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Thu Aug 14 17:46:55 2014
@@ -798,19 +798,21 @@ static int ajp_unmarshal_response(jk_msg
 static void ajp_abort_endpoint(ajp_endpoint_t * ae, int shutdown, jk_logger_t *l)
 {
     JK_TRACE_ENTER(l);
-    if (shutdown == JK_TRUE && IS_VALID_SOCKET(ae->sd)) {
-        if (ae->hard_close) {
-            /* Force unclean connection close to communicate client write errors
-             * back to Tomcat by aborting AJP response writes.
-             */
-            jk_close_socket(ae->sd, l);
-        }
-        else {
-            jk_shutdown_socket(ae->sd, l);
+    if (IS_VALID_SOCKET(ae->sd)) {
+        if (shutdown == JK_TRUE) {
+            if (ae->hard_close) {
+                /* Force unclean connection close to communicate client write errors
+                 * back to Tomcat by aborting AJP response writes.
+                 */
+                jk_close_socket(ae->sd, l);
+            }
+            else {
+                jk_shutdown_socket(ae->sd, l);
+            }
         }
         ae->worker->s->connected--;
+        ae->sd = JK_INVALID_SOCKET;
     }
-    ae->sd = JK_INVALID_SOCKET;
     ae->last_op = JK_AJP13_END_RESPONSE;
     JK_TRACE_EXIT(l);
 }

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1618000&r1=1617999&r2=1618000&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Thu Aug 14 17:46:55 2014
@@ -45,6 +45,11 @@
   <subsection name="Native">
     <changelog>
       <fix>
+        <bug>56703</bug>: Status: Fix inflated counter for current number
+        of backend connections especially when a connection timeout occured
+        on the backend. (rjung)
+      </fix>
+      <fix>
         <bug>56661</bug>: Fix Servlet API getLocalAddr().
         Works for Tomcat 6.0.42, 7.0.55 and 8.0.11 and Apache and ISAPI
         plugins. (rjung)



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