You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2014/06/26 02:24:44 UTC

svn commit: r1605639 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS modules/proxy/mod_proxy_fcgi.c

Author: trawick
Date: Thu Jun 26 00:24:44 2014
New Revision: 1605639

URL: http://svn.apache.org/r1605639
Log:
Merge r1592037 from trunk:

mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.

Submitted by: trawick
Reviewed by: covener, ylavic

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_fcgi.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1592037

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1605639&r1=1605638&r2=1605639&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Thu Jun 26 00:24:44 2014
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.10
 
+  *) mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
+     [Jeff Trawick]
+
   *) event MPM: Fix possible crashes (third party modules accessing c->sbh) 
      or occasional missed mod_status updates under load. 
      [Edward Lu <Chaosed0 gmail com>]

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1605639&r1=1605638&r2=1605639&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Thu Jun 26 00:24:44 2014
@@ -100,10 +100,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
  
-   * mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
-     trunk patch: http://svn.apache.org/r1592037
-     2.4.x patch: http://people.apache.org/~trawick/r1592037.txt
-     +1: trawick, covener, ylavic
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_fcgi.c?rev=1605639&r1=1605638&r2=1605639&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_fcgi.c Thu Jun 26 00:24:44 2014
@@ -90,26 +90,13 @@ static int proxy_fcgi_canon(request_rec 
 static apr_status_t send_data(proxy_conn_rec *conn,
                               struct iovec *vec,
                               int nvec,
-                              apr_size_t *len,
-                              int blocking)
+                              apr_size_t *len)
 {
-    apr_status_t rv = APR_SUCCESS, arv;
+    apr_status_t rv = APR_SUCCESS;
     apr_size_t written = 0, to_write = 0;
     int i, offset;
-    apr_interval_time_t old_timeout;
     apr_socket_t *s = conn->sock;
 
-    if (!blocking) {
-        arv = apr_socket_timeout_get(s, &old_timeout);
-        if (arv != APR_SUCCESS) {
-            return arv;
-        }
-        arv = apr_socket_timeout_set(s, 0);
-        if (arv != APR_SUCCESS) {
-            return arv;
-        }
-    }
-
     for (i = 0; i < nvec; i++) {
         to_write += vec[i].iov_len;
     }
@@ -118,7 +105,7 @@ static apr_status_t send_data(proxy_conn
     while (to_write) {
         apr_size_t n = 0;
         rv = apr_socket_sendv(s, vec + offset, nvec - offset, &n);
-        if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
+        if (rv != APR_SUCCESS) {
             break;
         }
         if (n > 0) {
@@ -141,12 +128,6 @@ static apr_status_t send_data(proxy_conn
     conn->worker->s->transferred += written;
     *len = written;
 
-    if (!blocking) {
-        arv = apr_socket_timeout_set(s, old_timeout);
-        if ((arv != APR_SUCCESS) && (rv == APR_SUCCESS)) {
-            return arv;
-        }
-    }
     return rv;
 }
 
@@ -207,7 +188,7 @@ static apr_status_t send_begin_request(p
     vec[1].iov_base = (void *)abrb;
     vec[1].iov_len = sizeof(abrb);
 
-    return send_data(conn, vec, 2, &len, 1);
+    return send_data(conn, vec, 2, &len);
 }
 
 static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
@@ -294,7 +275,7 @@ static apr_status_t send_environment(pro
         vec[1].iov_base = body;
         vec[1].iov_len = required_len;
 
-        rv = send_data(conn, vec, 2, &len, 1);
+        rv = send_data(conn, vec, 2, &len);
         apr_pool_clear(temp_pool);
 
         if (rv) {
@@ -309,7 +290,7 @@ static apr_status_t send_environment(pro
     vec[0].iov_base = (void *)farray;
     vec[0].iov_len = sizeof(farray);
 
-    return send_data(conn, vec, 1, &len, 1);
+    return send_data(conn, vec, 1, &len);
 }
 
 enum {
@@ -482,7 +463,7 @@ static apr_status_t dispatch(proxy_conn_
                     ++nvec;
                 }
 
-                rv = send_data(conn, vec, nvec, &len, 0);
+                rv = send_data(conn, vec, nvec, &len);
                 if (rv != APR_SUCCESS) {
                     *err = "sending stdin";
                     break;
@@ -506,7 +487,7 @@ static apr_status_t dispatch(proxy_conn_
                 vec[0].iov_base = (void *)farray;
                 vec[0].iov_len = sizeof(farray);
 
-                rv = send_data(conn, vec, 1, &len, 1);
+                rv = send_data(conn, vec, 1, &len);
                 if (rv != APR_SUCCESS) {
                     *err = "sending empty stdin";
                     break;