From 89b7aba0f33d296b52b58d73f2805352a3f83db9 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 15 Oct 2012 14:38:04 +0000 Subject: [PATCH] * If we face a timeout during receiving the response from the backend and if 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 3736156afcd..e796f73b5e4 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -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; + } } } -- 2.47.3