Commit Graph

218 Commits

Author SHA1 Message Date
21cdbc9854 mod_proxy_balancer: follow up to r1830800.
Don't call slotmem_attach() if the slot is already initialized/reused, that
used to work previously because the returned error status is ignored, but
r1830800 changed the function to forcibly reset the returned slot pointer to
NULL first.

There is no point to call slotmem_attach() in this case, the slot is already
initialized because it's either inherited/fork()ed on Unixes, or on Windows
the attachment happened in post_config/slotmem_create() already.

One case where slotmem_attach() would fail is when balancers are defined
globally (main server) and some virtualhosts don't have/use any mod_proxy
configuration/directive. In this case their proxy server config is a pointer
copy of the main server thus their slots are already initialized in both
post_config and child_init hooks. While the case was already handled in
the balancer_post_config(), it did not in balancer_child_init() where we
relied on slotmem_attach() to be a noop.

[Reverted by r1831396]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831218 13f79535-47bb-0310-9956-ffa450edef68
2018-05-09 01:23:59 +00:00
55b4505765 mod_proxy_balancer: Add hot spare member type and corresponding flag (R). Hot spare members are
used as drop-in replacements for unusable workers in the same load balancer set. This differs
from hot standbys which are only used when all workers in a set are unusable. PR 61140.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828890 13f79535-47bb-0310-9956-ffa450edef68
2018-04-11 12:11:05 +00:00
fac7f995b0 mod_proxy: Provide an RFC1035 compliant version of the hostname in the
proxy_worker_shared structure. PR62085


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824176 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 21:22:05 +00:00
fad6cd0e46 mod_proxy_balancer: follow up tp r1822509.
Rework server_rec ID so that it doesn't change on restart (or stop/start)
unless it's Host(s)/IP(s):port(s), ServerName and/or ServerAlias(es) changed.

The goal being to reuse SHMs (and persisted files) names as much as possible,
with minimal bindings to configuration changes (as far as mod_proxy_balancer
is concerned). So if the ServerName and first Host/IP:port are unique we use
that first, otherwise the ServerAlias(es) and other Host(s)/IP(s):port(s) are
also taken into account, and finally if that's still not enough the server
index is also used (pathological case handled for correctness with regard to
the underlying mod_slotmem_shm's reuse code).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823564 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 15:08:09 +00:00
37578399ef Revert r1822800 and r1822804.
All was already there, I just misread name vs sname :/



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822806 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 14:25:53 +00:00
7c2fce4a11 mod_proxy_balancer: follow up tp r1822509 and r1822800.
Actually we already have an (per vhost) unique id for the balancer, so use it.

[Reverted by r1822806]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822804 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 14:15:03 +00:00
bf336e8280 mod_proxy_balancer: follow up tp r1822509.
Use a unique balancer id per vhost for workers' slotmem too.

[Reverted by r1822806]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822800 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 13:55:53 +00:00
84cabd2d8e Revert r1813167 (per review).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1813255 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 07:23:34 +00:00
abea15ba12 mod_proxy_balancer: fix runtime lbfactor value changed in 2.4.28.
It is assumed to be between 1 and 100 by lbmethods, so normalize it
accordingly.

[Reverted by r1813255]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1813167 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 10:50:34 +00:00
8dc841ea11 Fix remaining lint from ms capability for hchecks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805206 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 15:14:48 +00:00
737e70ca1f Umm. This is C :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805190 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 13:07:31 +00:00
d248d8b2ff loadfactor now decimal
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805188 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 12:57:41 +00:00
7a9415519a OK... we display ms, since we want to be able to provide
values for <1sec, so entries should assume ms input when
using bal-mgr



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799485 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 16:29:54 +00:00
d1c3e06c4a allow balancer-manager to also accept subsecond intervals
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799482 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 16:24:00 +00:00
cc97ce3e52 https://bz.apache.org/bugzilla/show_bug.cgi?id=58855
Optimize check for empty strings


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778067 13f79535-47bb-0310-9956-ffa450edef68
2017-01-09 22:08:01 +00:00
af9775ba47 * Prevent redirect loops between workers within a balancer by limiting the
number of redirects to the number balancer members.

PR: 59864


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753594 13f79535-47bb-0310-9956-ffa450edef68
2016-07-20 18:32:14 +00:00
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
e81d9afe33 Actually, do the nulling indepedent of whether it is being
set or not.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728209 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:49:23 +00:00
89058e7b74 If disabling health check (NONE) or using TCP method, then
the expression is moot and is nulled out

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728208 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:49:17 +00:00
ddc56a597b Now honor changed params!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728203 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:28:13 +00:00
3d4399435e Now input-ize the values... next step is to tie into the
actual POST

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728166 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 18:04:46 +00:00
ee6d08cab1 Tie bal-man to hcheck for dynamic adjustments... right now,
actually editing not implemented yet.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728161 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 17:23:43 +00:00
d082119d56 Better naming
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728155 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:45:39 +00:00
a64b2be937 Only show if hcheck module is loaded
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728154 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:45:32 +00:00
62a5f9e552 Since these are externs, prepend proxy_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728148 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:21:38 +00:00
ad328cbcf4 expose more worker status info in prep for making
more dynamically changable

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728142 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 14:56:30 +00:00
a107563a23 And make the list of health check conditions viewable via
the balancer manager :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725609 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 20:48:33 +00:00
5ec89deb21 Expose the expr
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725608 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 20:48:24 +00:00
7cc83fe9ab Use worker status character defines taken
from mod_proxy.h instead of explicit characters.

Noted by rpluem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725602 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 19:44:13 +00:00
52916ae253 Open up hook/scar to allow for passes/fails and
method to be changed via bal-man...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725498 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:49:56 +00:00
26019784af Expose this in our API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725306 13f79535-47bb-0310-9956-ffa450edef68
2016-01-18 16:54:06 +00:00
2fda66ec46 Make balancer manager health-check aware
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725120 13f79535-47bb-0310-9956-ffa450edef68
2016-01-17 20:12:09 +00:00
c80e6b2a34 Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:46:01 +00:00
3c9ddf44bf Revert r1715789: will re-commit without spurious functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:28:36 +00:00
29843dc73f Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
[Reverted by r1715869]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 12:33:09 +00:00
96f716ff3a Adjust since we are now in shared mem area
Thx Werror: error: address of array 'balancer->s->sticky' will always evaluate to 'true'


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705776 13f79535-47bb-0310-9956-ffa450edef68
2015-09-28 21:04:45 +00:00
d1ad117a18 Revert r1696960 (see commit thread).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1698123 13f79535-47bb-0310-9956-ffa450edef68
2015-08-27 11:45:06 +00:00
1cd406d23e mod_proxy_balancer: Fix balancers and balancer members reuse on
restart when new ones are added.  PR 58024.

Since slotmem_create() issues a strict check on the size of an existing
slot before reusing it, it won't reuse existing balancers and members when
new ones are added during restart (whereas growth margins would allow it).
Fix this by using slotmem_attach() first and if it succeeds do the checks
based on the returned previous number of existing entries.

[Reverted by r1698123]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1696960 13f79535-47bb-0310-9956-ffa450edef68
2015-08-21 12:34:02 +00:00
83c5985cbb Fresheh html
BUGZ:55466

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664356 13f79535-47bb-0310-9956-ffa450edef68
2015-03-05 14:35:34 +00:00
70201cd149 * Fix typo in error message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664133 13f79535-47bb-0310-9956-ffa450edef68
2015-03-04 20:16:34 +00:00
b26841b8dc mod_proxy(es): Avoid error response/document handling by the core if some
input filter already did it while reading client's payload.

When an input filter returns AP_FILTER_ERROR, it has already called ap_die()
or at least already responded to the client.

Here we don't want to lose AP_FILTER_ERROR when returning from proxy handlers,
so we use ap_map_http_request_error() to forward any AP_FILTER_ERROR to
ap_die() which knows whether a response needs to be completed or not.

Before this commit, returning an HTTP error code in this case caused a double
response to be generated.

Depends on r1657881 to preserve r->status (for logging) when nothing is to be
done by ap_die() when handling AP_FILTER_ERROR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657897 13f79535-47bb-0310-9956-ffa450edef68
2015-02-06 16:54:16 +00:00
1f6fd365c3 mod_proxy: Don't put non balancer-member workers in error state by
default for connection or 500/503 errors, and honor status=+I for
any error.  PR 48388.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650028 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 10:36:12 +00:00
a9c4c3a37d Concat string at compile time when possible.
Doing so, sometimes also give the opportunity to turn a 'ap_fputstrs' into a 'ap_fputs'.
PR 53741

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626050 13f79535-47bb-0310-9956-ffa450edef68
2014-09-18 19:06:52 +00:00
f17e7e5e10 * Correctly escape user provided data.
PR: 56532
Submitted by: Maksymilian <max cert.cx>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595305 13f79535-47bb-0310-9956-ffa450edef68
2014-05-16 18:54:19 +00:00
347c75b3c5 Put the uds path in its own field, and adjust the logic
to look for an empty string rather than a flag.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1533087 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 14:10:43 +00:00
c984a2e5f3 Ensure that userland format of UDS is the same as how it is
configured, no matter how we store and use it internally.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531962 13f79535-47bb-0310-9956-ffa450edef68
2013-10-14 16:12:30 +00:00
0605393196 syntax sugar... if the worker is associated w/ a UDS,
then make sure the log reporting has a visual clue.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531370 13f79535-47bb-0310-9956-ffa450edef68
2013-10-11 17:36:24 +00:00
e40e0a785b Reformat the UDS support inline with a new naming structure.
Use a flag for speed for testing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531340 13f79535-47bb-0310-9956-ffa450edef68
2013-10-11 16:12:41 +00:00
f443750523 More cool info ;)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524158 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 18:31:58 +00:00
d3a30a09ab Add note to balancer manager whether changes will/will not survive a restart
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524101 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 15:46:56 +00:00