diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-05-20 15:08:13 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-05-20 15:08:13 +0200 |
commit | 33bd5995b02e475bac2cc60e6e2273b23b88dc34 (patch) | |
tree | 81f49c0f445de45bc61c007fdbed875ae650e203 /modules/proxy/mod_proxy_balancer.c | |
parent | mod_slotmem_shm: follow up to r1831869: fix persisted file size's checksum. (diff) | |
download | apache2-33bd5995b02e475bac2cc60e6e2273b23b88dc34.tar.xz apache2-33bd5995b02e475bac2cc60e6e2273b23b88dc34.zip |
mod_proxy_balancer: clear slotmem slots' inuse flags from persisted files.
Otherwise, when BalancerPersist is enabled, we might fail (re)starting with a
saved slotmem if a BalancerMember was renamed (e.g. PR 62308's port change).
This is because the renamed member is considered a new one, while the old name
still reserves a slot, so we end up missing one room. The overall number of
members does not change so the sizes check succeeds thus the persisted slotmem
is not invalidated. Yet the slomem is not really compatible.
By clearing inuse flags, we still allow for slots to be reused if their index
did not change (thanks to ap_proxy_find_balancershm() and slotmem_fgrab() at
the given index), but will also invalidate renamed slots which don't match the
index. We now have the correct behaviour by slot and the server (re)starts in
any case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/mod_proxy_balancer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 42fd97b125..347481a323 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -908,7 +908,7 @@ static int balancer_post_config(apr_pool_t *pconf, apr_pool_t *plog, continue; } if (conf->bal_persist) { - type = AP_SLOTMEM_TYPE_PERSIST; + type = AP_SLOTMEM_TYPE_PERSIST | AP_SLOTMEM_TYPE_CLEARINUSE; } else { type = 0; } |