httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drugg...@apache.org
Subject svn commit: r1465839 - in /httpd/httpd/trunk: docs/log-message-tags/ docs/manual/mod/ modules/proxy/
Date Tue, 09 Apr 2013 00:18:44 GMT
Author: druggeri
Date: Tue Apr  9 00:18:42 2013
New Revision: 1465839

URL: http://svn.apache.org/r1465839
Log:
Add failontimeout to allow server admin to mark balancer member in err if IO timeout occurs.

Modified:
    httpd/httpd/trunk/docs/log-message-tags/next-number
    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_http.c

Modified: httpd/httpd/trunk/docs/log-message-tags/next-number
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/log-message-tags/next-number?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/log-message-tags/next-number (original)
+++ httpd/httpd/trunk/docs/log-message-tags/next-number Tue Apr  9 00:18:42 2013
@@ -1 +1 @@
-2460
+2461

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Tue Apr  9 00:18:42 2013
@@ -1138,6 +1138,12 @@ ProxyPass /mirror/foo http://backend.exa
         force the worker into error state when the backend returns any status code
         in the list. Worker recovery behaves the same as other worker errors.
     </td></tr>
+    <tr><td>failontimeout</td>
+        <td>Off</td>
+        <td>If set, an IO read timeout after a request is sent to the backend will
+        force the worker into error state. Worker recovery behaves the same as other
+        worker errors.
+    </td></tr>
     <tr><td>nonce</td>
         <td>&lt;auto&gt;</td>
         <td>The protective nonce used in the <code>balancer-manager</code>
application page.

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Tue Apr  9 00:18:42 2013
@@ -383,6 +383,14 @@ static const char *set_balancer_param(pr
         }
 
     }
+    else if (!strcasecmp(key, "failontimeout")) {
+        if (!strcasecmp(val, "on"))
+            balancer->failontimeout = 1;
+        else if (!strcasecmp(val, "off"))
+            balancer->failontimeout = 0;
+        else
+            return "failontimeout must be On|Off";
+    }
     else if (!strcasecmp(key, "nonce")) {
         if (!strcasecmp(val, "None")) {
             *balancer->s->nonce = '\0';

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Tue Apr  9 00:18:42 2013
@@ -451,6 +451,7 @@ struct proxy_balancer {
     proxy_server_conf *sconf;
     void            *context;    /* general purpose storage */
     proxy_balancer_shared *s;    /* Shared data */
+    int failontimeout;           /* Whether to mark a member in Err if IO timeout occurs
*/
 };
 
 struct proxy_balancer_method {

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=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Tue Apr  9 00:18:42 2013
@@ -662,6 +662,7 @@ static int ap_proxy_ajp_request(apr_pool
              * but doesn't affect the whole worker.
              */
             if (APR_STATUS_IS_TIMEUP(status) && conn->worker->s->ping_timeout_set)
{
+                apr_table_set(r->notes, "proxy_timedout", "1");
                 rv = HTTP_GATEWAY_TIME_OUT;
             }
             else {

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue Apr  9 00:18:42 2013
@@ -649,6 +649,17 @@ static int proxy_balancer_post_request(p
         }
     }
 
+    if (balancer->failontimeout
+        && (apr_table_get(r->notes, "proxy_timedout")) != NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02460)
+                      "%s: Forcing worker (%s) into error state "
+                      "due to timeout and 'failonstatus' parameter being set",
+                       balancer->s->name, worker->s->name);
+        worker->s->status |= PROXY_WORKER_IN_ERROR;
+        worker->s->error_time = apr_time_now();
+
+    }
+
     if ((rv = PROXY_THREAD_UNLOCK(balancer)) != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01175)
                       "%s: Unlock failed for post_request", balancer->s->name);

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=1465839&r1=1465838&r2=1465839&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Tue Apr  9 00:18:42 2013
@@ -1312,6 +1312,7 @@ apr_status_t ap_proxy_http_process_respo
                           "error reading status line from remote "
                           "server %s:%d", backend->hostname, backend->port);
             if (APR_STATUS_IS_TIMEUP(rc)) {
+                apr_table_set(r->notes, "proxy_timedout", "1");
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01103) "read timeout");
                 if (do_100_continue) {
                     return ap_proxyerror(r, HTTP_SERVICE_UNAVAILABLE, "Timeout on 100-Continue");



Mime
View raw message