You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jf...@apache.org on 2011/04/14 11:36:14 UTC

svn commit: r1092076 - in /httpd/httpd/trunk/modules/proxy: ajp_link.c mod_proxy_ajp.c

Author: jfclere
Date: Thu Apr 14 09:36:14 2011
New Revision: 1092076

URL: http://svn.apache.org/viewvc?rev=1092076&view=rev
Log:
try to prevent a single long request marking a worker in error.

Modified:
    httpd/httpd/trunk/modules/proxy/ajp_link.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Modified: httpd/httpd/trunk/modules/proxy/ajp_link.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp_link.c?rev=1092076&r1=1092075&r2=1092076&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/ajp_link.c (original)
+++ httpd/httpd/trunk/modules/proxy/ajp_link.c Thu Apr 14 09:36:14 2011
@@ -84,7 +84,7 @@ apr_status_t ajp_ilink_receive(apr_socke
     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);

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=1092076&r1=1092075&r2=1092076&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Thu Apr 14 09:36:14 2011
@@ -336,6 +336,15 @@ static int ap_proxy_ajp_request(apr_pool
                      "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



Re: svn commit: r1092076 - in /httpd/httpd/trunk/modules/proxy: ajp_link.c mod_proxy_ajp.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 04/14/2011 11:36 AM, jfclere@apache.org wrote:
> Author: jfclere
> Date: Thu Apr 14 09:36:14 2011
> New Revision: 1092076
> 
> URL: http://svn.apache.org/viewvc?rev=1092076&view=rev
> Log:
> try to prevent a single long request marking a worker in error.
> 
> Modified:
>     httpd/httpd/trunk/modules/proxy/ajp_link.c
>     httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
> 
> Modified: httpd/httpd/trunk/modules/proxy/ajp_link.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp_link.c?rev=1092076&r1=1092075&r2=1092076&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/ajp_link.c (original)
> +++ httpd/httpd/trunk/modules/proxy/ajp_link.c Thu Apr 14 09:36:14 2011
> @@ -84,7 +84,7 @@ apr_status_t ajp_ilink_receive(apr_socke
>      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);

Please use APR_STATUS_IS_TIMEUP instead of directly comparing to APR_TIMEUP
as codes can vary on different platforms.

>      }
>  
>      status = ajp_msg_check_header(msg, &blen);
> 
> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=1092076&r1=1092075&r2=1092076&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
> +++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Thu Apr 14 09:36:14 2011
> @@ -336,6 +336,15 @@ static int ap_proxy_ajp_request(apr_pool
>                       "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;
> +        }
> +

Same as above.

Regards

RĂ¼diger