]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
try to prevent a single long request marking a worker in error.
authorJean-Frederic Clere <jfclere@apache.org>
Thu, 14 Apr 2011 09:36:14 +0000 (09:36 +0000)
committerJean-Frederic Clere <jfclere@apache.org>
Thu, 14 Apr 2011 09:36:14 +0000 (09:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1092076 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/ajp_link.c
modules/proxy/mod_proxy_ajp.c

index 56b7c0eac2589411abae6811be25d04cb92d66df..7b9959998232308f723257874f743ccfe9594a8d 100644 (file)
@@ -84,7 +84,7 @@ apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg)
     if (status != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, status, NULL,
                      "ajp_ilink_receive() can't receive header");
-        return AJP_ENO_HEADER;
+        return (status == APR_TIMEUP ? APR_TIMEUP : AJP_ENO_HEADER);
     }
 
     status = ajp_msg_check_header(msg, &blen);
index af78c60e923bd6f1f2eb2fd7b894f9e5070662b1..a54e03ea64d7e2f241abc4e3e60ae27a6ab270bf 100644 (file)
@@ -336,6 +336,15 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
                      "proxy: read response failed from %pI (%s)",
                      conn->worker->cp->addr,
                      conn->worker->s->hostname);
+
+        /* If we had a successful cping/cpong and then a timeout
+         * we assume it is a request that cause a back-end timeout,
+         * but doesn't affect the whole worker.
+         */
+        if (status == APR_TIMEUP && conn->worker->ping_timeout_set) {
+            return HTTP_GATEWAY_TIME_OUT;
+        }
+
         /*
          * This is only non fatal when we have not sent (parts) of a possible
          * request body so far (we do not store it and thus cannot send it