Commit 61a0edd2 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

mod_proxy_balancer: Force workers into PROXY_WORKER_IN_ERROR when configured

statuses are found

PR: 48939
Backports: 930125, 930254, 962972, 987359
Submitted by: Daniel Ruggeri <DRuggeri primary.net>
Reviewed by: trawick, niq, wrowe



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1005571 13f79535-47bb-0310-9956-ffa450edef68
parent 0435dcee
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.2.17

  *) Proxy balancer: support setting error status according to HTTP response
     code from a backend.  PR 48939.  [Daniel Ruggeri <DRuggeri primary.net>]

  *) mod_authnz_ldap: If AuthLDAPCharsetConfig is set, also convert the
     password to UTF-8. PR 45318.
     [Johannes Müller <joh_m gmx.de>, Stefan Fritsch]
+0 −15
Changes for STATUS: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -87,21 +87,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

    * mod_proxy_balancer: Force workers into PROXY_WORKER_IN_ERROR when configured
      statuses are found
      PR: 48939
      Trunk patches: http://svn.apache.org/viewvc?rev=930125&view=rev
                     http://svn.apache.org/viewvc?rev=930254&view=rev
                     http://svn.apache.org/viewvc?rev=962972&view=rev
                     http://svn.apache.org/viewvc?rev=987359&view=rev
      2.2.x patch:  https://issues.apache.org/bugzilla/attachment.cgi?id=25923
      plus this CHANGES entry:
      *) Proxy balancer: support setting error status according to HTTP response
         code from a backend.  PR 48939.  [Daniel Ruggeri <DRuggeri primary.net>]
     Submitted by: Daniel Ruggeri <DRuggeri primary.net>
     +1: trawick, wrowe
     niq: +1 to the 2.2.x patch, but why r951900 and r987379 in trunk patches?


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+6 −0
Changes for docs/manual/mod/mod_proxy.xml: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -979,6 +979,12 @@ expressions</description>
        <td>Balancer timeout in seconds. If set this will be the maximum time
        to wait for a free worker. Default is not to wait. 
    </td></tr>
    <tr><td>failonstatus</td>
        <td>-</td>
        <td>A single or comma-separated list of HTTP status codes. If set this will
        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>
    
    </table>
    <p>A sample balancer setup</p>
+2 −1
Changes for include/ap_mmn.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@
 * 20051115.23 (2.2.12) Add ap_open_piped_log_ex API, with cmdtype option,
 *                      and conditional cmdtype member of piped_log struct
 * 20051115.24 (2.2.15) Add forward member to proxy_conn_rec
 * 20051115.25 (2.2.17) Add errstatuses member to proxy_balancer
 */

#define MODULE_MAGIC_COOKIE 0x41503232UL /* "AP22" */
@@ -146,7 +147,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20051115
#endif
#define MODULE_MAGIC_NUMBER_MINOR 24                    /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 25                    /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+22 −0
Changes for modules/proxy/mod_proxy.c: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -365,6 +365,28 @@ static const char *set_balancer_param(proxy_server_conf *conf,
        else
            return "scolonpathdelim must be On|Off";
    }
    else if (!strcasecmp(key, "failonstatus")) {
        char *val_split;
        char *status;
        char *tok_state;

        val_split = apr_pstrdup(p, val);

        balancer->errstatuses = apr_array_make(p, 1, sizeof(int));

        status = apr_strtok(val_split, ", ", &tok_state);
        while (status != NULL) {
            ival = atoi(status);
            if (ap_is_HTTP_VALID_RESPONSE(ival)) {
                *(int *)apr_array_push(balancer->errstatuses) = ival;
            }
            else {
                return "failonstatus must be one or more HTTP response codes";
            }
            status = apr_strtok(NULL, ", ", &tok_state);
        }

    }
    else {
        return "unknown Balancer parameter";
    }
Loading