Source: apache2
Version: 2.4.10-10+deb8u7
Severity: important
Tags: patch

Dear Maintainer,

This report is meant to ask the backport in Jessie of some
mod-proxy-fcgi accepted patches of the httpd 2.4.x upstream
branch, as a continuation of the work started with:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827472

The major benefit is to remove spurious error log entries
(AH01075,AH01068,AH01069) and wrong HTTP 503 access log
entries. The current Jessie's version of apache2 in fact
does not handle very well FCGI responses carrying a paylod
that end up in a HTTP 304: it returns the correct HTTP
status to the external client (thanks to a EOS bucket)
but then it mistakenly tag the remaining body payload 
as "wrong" FCGI response (without a valid header) logging
a HTTP 503 in the access log. 

Wikimedia has been running the apache2 with these patches
for months in production.

Thanks in advance!

Regards,

Luca

- 

-- System Information:
Debian Release: 8.6
  APT prefers stable
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-2-amd64
Init: systemd

-

Description: Consume the body of the response from a FCGI server when a 304 is 
returned.
Origin: https://svn.apache.org/viewvc?view=revision&revision=1752347
Bug-Apache: https://bz.apache.org/bugzilla/show_bug.cgi?id=57398
Reviewed-by: Giuseppe Lavagetto <glavage...@wikimedia.org>
Last-Update: 2016-07-28
--- a/modules/proxy/mod_proxy_fcgi.c    2016-07-18 14:40:37.667123835 +0000
+++ b/modules/proxy/mod_proxy_fcgi.c    2016-07-18 14:52:20.678845424 +0000
@@ -576,8 +576,12 @@
                                 tmp_b = apr_bucket_eos_create(c->bucket_alloc);
                                 APR_BRIGADE_INSERT_TAIL(ob, tmp_b);
                                 r->status = status;
-                                ap_pass_brigade(r->output_filters, ob);
-                                if (status == HTTP_NOT_MODIFIED) {
+                                rv = ap_pass_brigade(r->output_filters, ob);
+                                if (rv != APR_SUCCESS) {
+                                    *err = "passing headers brigade to output 
filters";
+                                    break;
+                                }
+                                else if (status == HTTP_NOT_MODIFIED) {
                                     /* The 304 response MUST NOT contain
                                      * a message-body, ignore it. */
                                     ignore_body = 1;
@@ -586,8 +590,8 @@
                                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 
APLOGNO(01070)
                                                     "Error parsing script 
headers");
                                     rv = APR_EINVAL;
+                                    break;
                                 }
-                                break;
                             }

                             if (conf->error_override &&


Description: Stop reading the response and issue an error when parsing or 
forwarding the response fails.
Origin: https://svn.apache.org/viewvc?view=revision&revision=1642855
Bug-Apache: https://bz.apache.org/bugzilla/show_bug.cgi?id=57398
Reviewed-by: Giuseppe Lavagetto <glavage...@wikimedia.org>
Last-Update: 2016-07-28
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -692,6 +692,10 @@
                               "Got bogus record %d", type);
                 break;
             }
+            /* Leave on above switch's inner error. */
+            if (rv != APR_SUCCESS) {
+                break;
+            }

             if (plen) {
                 rv = get_data_full(conn, iobuf, plen);


Description: Don't log an error on client-side disconnections
Origin: http://svn.apache.org/viewvc?view=revision&revision=1726019
Bug-Apache: https://bz.apache.org/bugzilla/show_bug.cgi?id=57398
Reviewed-by: Giuseppe Lavagetto <glavage...@wikimedia.org>
Last-Update: 2016-07-28
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -761,6 +761,16 @@
     /* Step 3: Read records from the back end server and handle them. */
     rv = dispatch(conn, conf, r, temp_pool, request_id, &err);
     if (rv != APR_SUCCESS) {
+        /* If the client aborted the connection during retrieval or (partially)
+         * sending the response, dont't return a HTTP_SERVICE_UNAVAILABLE, 
since
+         * this is not a backend problem. */
+        if (r->connection->aborted) {
+            ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r,
+                          "The client aborted the connection.");
+            conn->close = 1;
+            return OK;
+        }
+
         ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01075)
                       "Error dispatching request to %s: %s%s%s",
                       server_portstr,

Reply via email to