]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* If we face a timeout during receiving the response from the backend and if
authorRuediger Pluem <rpluem@apache.org>
Mon, 15 Oct 2012 14:38:04 +0000 (14:38 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 15 Oct 2012 14:38:04 +0000 (14:38 +0000)
  we pinged it successfully before don't assume the whole backend has failed.
  Assume that only the request has failed and return a gateway timeout then.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398307 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_ajp.c

index 3736156afcdd1620295ae0d98d312c44d425a7d9..e796f73b5e4566f98d8357e3e6d00d57e0cb4207 100644 (file)
@@ -657,7 +657,16 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
              */
             rv = HTTP_SERVICE_UNAVAILABLE;
         } else {
-            rv = HTTP_INTERNAL_SERVER_ERROR;
+            /* 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 (APR_STATUS_IS_TIMEUP(status) && conn->worker->s->ping_timeout_set) {
+                rv = HTTP_GATEWAY_TIME_OUT;
+            }
+            else {
+                rv = HTTP_INTERNAL_SERVER_ERROR;
+            }
         }
     }