Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFDFACB52 for ; Thu, 27 Jun 2013 16:22:54 +0000 (UTC) Received: (qmail 62925 invoked by uid 500); 27 Jun 2013 16:22:54 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 62871 invoked by uid 500); 27 Jun 2013 16:22:53 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 62861 invoked by uid 99); 27 Jun 2013 16:22:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 16:22:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 16:22:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 529C62388993; Thu, 27 Jun 2013 16:22:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1497423 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS docs/manual/mod/mod_proxy.xml modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/mod_proxy_balancer.c modules/proxy/mod_proxy_http.c Date: Thu, 27 Jun 2013 16:22:31 -0000 To: cvs@httpd.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130627162232.529C62388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Thu Jun 27 16:22:31 2013 New Revision: 1497423 URL: http://svn.apache.org/r1497423 Log: mod_proxy_balancer: Add failontimeout parameter. Timeout will put worker in error state if an IO timeout is detected. Backports: r1465839 Submitted by: druggeri Reviewed by: druggeri, wrowe, rjung Modified: httpd/httpd/branches/2.2.x/CHANGES httpd/httpd/branches/2.2.x/STATUS httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_balancer.c httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c Modified: httpd/httpd/branches/2.2.x/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original) +++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Thu Jun 27 16:22:31 2013 @@ -24,6 +24,10 @@ Changes with Apache 2.2.25 *) mod_dav: Ensure URI is correctly uriencoded on return. PR 54611 [Timothy Wood ] + *) Added balancer parameter failontimeout to allow server admin + to configure an IO timeout as an error in the balancer. + [Daniel Ruggeri] + Changes with Apache 2.2.24 *) SECURITY: CVE-2012-3499 (cve.mitre.org) Modified: httpd/httpd/branches/2.2.x/STATUS URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/STATUS (original) +++ httpd/httpd/branches/2.2.x/STATUS Thu Jun 27 16:22:31 2013 @@ -114,15 +114,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_proxy_balancer: Add failontimeout parameter. Timeout will put worker - in error state if an IO timeout is detected. - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1465839 - 2.4.x patch: http://svn.apache.org/viewvc?view=revision&revision=1476689 - 2.2.x patch: http://people.apache.org/~druggeri/patches/httpd-2.2.x-failontimeout.patch - +1: druggeri, wrowe, rjung - rjung: it would be nice to fix the indentation for the new - ap_log_rerror(...) in modules/proxy/mod_proxy_balancer.c. - * mod_dav: Make sure that when we prepare an If URL for Etag comparison, we compare unencoded paths. PR 53910 [Timothy Wood ] trunk patch: http://svn.apache.org/r1470940 Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml (original) +++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml Thu Jun 27 16:22:31 2013 @@ -1005,6 +1005,13 @@ expressions in the list. Worker recovery behaves the same as other worker errors. Available with Apache HTTP Server 2.2.17 and later. + failontimeout + Off + 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. + Available with Apache HTTP Server 2.2.25 and later. + forcerecovery On Force the immediate recovery of all workers without considering the Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Thu Jun 27 16:22:31 2013 @@ -387,6 +387,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, "forcerecovery")) { if (!strcasecmp(val, "on")) balancer->forcerecovery = 1; Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h Thu Jun 27 16:22:31 2013 @@ -389,6 +389,7 @@ struct proxy_balancer { apr_array_header_t *errstatuses; /* statuses to force members into error */ int forcerecovery; /* Force recovery if all workers are in error state */ + int failontimeout; /* Whether to mark a member in Err if IO timeout occurs */ }; struct proxy_balancer_method { Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_balancer.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_balancer.c?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_balancer.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_balancer.c Thu Jun 27 16:22:31 2013 @@ -629,6 +629,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, + "%s: Forcing worker (%s) into error state " + "due to timeout and 'failonstatus' parameter being set", + balancer->name, worker->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_error(APLOG_MARK, APLOG_ERR, rv, r->server, "proxy: BALANCER: (%s). Unlock failed for post_request", Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c?rev=1497423&r1=1497422&r2=1497423&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c Thu Jun 27 16:22:31 2013 @@ -1410,6 +1410,7 @@ apr_status_t ap_proxy_http_process_respo "proxy: 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, "proxy: read timeout"); }