Resolves: RHEL-122290 - mod_proxy_hcheck may stop healthchecks after a child

process is reclaimed
This commit is contained in:
Luboš Uhliarik 2025-10-24 13:16:35 +02:00
parent f2e7ddf5e9
commit bc23a5927d
2 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,66 @@
--- a/modules/proxy/mod_proxy_hcheck.c
+++ b/modules/proxy/mod_proxy_hcheck.c
@@ -989,12 +989,30 @@ static apr_status_t hc_watchdog_callback(int state
sctx_t *ctx = (sctx_t *)data;
server_rec *s = ctx->s;
proxy_server_conf *conf;
+ proxy_worker **workers;
+ proxy_worker *worker;
+ apr_time_t now;
+ int i, n;
+ conf = (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
+ balancer = (proxy_balancer *)conf->balancers->elts;
+
switch (state) {
case AP_WATCHDOG_STATE_STARTING:
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(03258)
"%s watchdog started.",
HCHECK_WATHCHDOG_NAME);
+ /* set last update time for all workers */
+ now = apr_time_now();
+ for (i = 0; i < conf->balancers->nelts; i++, balancer++) {
+ workers = (proxy_worker **)balancer->workers->elts;
+ for (n = 0; n < balancer->workers->nelts; n++, ++workers) {
+ worker = *workers;
+ if (worker->s->updated == 0) {
+ worker->s->updated = now;
+ }
+ }
+ }
#if HC_USE_THREADS
if (tpsize && hctp == NULL) {
rv = apr_thread_pool_create(&hctp, tpsize,
@@ -1020,21 +1038,13 @@ static apr_status_t hc_watchdog_callback(int state
case AP_WATCHDOG_STATE_RUNNING:
/* loop thru all workers */
- if (s) {
- int i;
- conf = (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
- balancer = (proxy_balancer *)conf->balancers->elts;
- ctx->s = s;
+ {
+ now = apr_time_now();
for (i = 0; i < conf->balancers->nelts; i++, balancer++) {
- int n;
- apr_time_t now;
- proxy_worker **workers;
- proxy_worker *worker;
/* Have any new balancers or workers been added dynamically? */
ap_proxy_sync_balancer(balancer, s, conf);
workers = (proxy_worker **)balancer->workers->elts;
- now = apr_time_now();
- for (n = 0; n < balancer->workers->nelts; n++) {
+ for (n = 0; n < balancer->workers->nelts; n++, workers++) {
worker = *workers;
if (!PROXY_WORKER_IS(worker, PROXY_WORKER_STOPPED) &&
(worker->s->method != NONE) &&
@@ -1074,7 +1084,6 @@ static apr_status_t hc_watchdog_callback(int state
hc_check(NULL, baton);
}
}
- workers++;
}
}
}

View File

@ -25,7 +25,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.63
Release: 5%{?dist}
Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
@ -109,6 +109,8 @@ Patch60: httpd-2.4.43-enable-sslv3.patch
Patch61: httpd-2.4.59-no-engine.patch
# https://issues.redhat.com/browse/RHEL-99815
Patch62: httpd-2.4.63-r1926107.patch
# https://issues.redhat.com/browse/RHEL-122290
Patch63: httpd-2.4.63-hcheck-stuck.patch
# Security fixes
#
@ -839,6 +841,10 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
* Fri Oct 24 2025 Luboš Uhliarik <luhliari@redhat.com> - 2.4.63-6
- Resolves: RHEL-122290 - mod_proxy_hcheck may stop healthchecks after a child
process is reclaimed
* Mon Sep 08 2025 Luboš Uhliarik <luhliari@redhat.com> - 2.4.63-5
- Resolves: RHEL-92663 - Image mode: The dir /var/www is not created when
updating system in image mode