diff --git a/changes-entries/proxy-balancer-before-watchdog.txt b/changes-entries/proxy-balancer-before-watchdog.txt new file mode 100644 index 00000000000..d3a45748302 --- /dev/null +++ b/changes-entries/proxy-balancer-before-watchdog.txt @@ -0,0 +1,3 @@ + *) mod_proxy_balancer: Set up the balancers in each child before the + watchdogs of mod_proxy_hcheck and mod_proxy_beacon use them. + [Jim Jagielski] diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index e8a5be228c2..3a7b64047dd 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -2056,12 +2056,15 @@ static void ap_proxy_balancer_register_hook(apr_pool_t *p) */ static const char *const aszPred[] = { "mpm_winnt.c", "mod_slotmem_shm.c", NULL}; static const char *const aszPred2[] = { "mod_proxy.c", NULL}; + /* mod_watchdog's child_init starts threads that walk the balancers + * (mod_proxy_hcheck, mod_proxy_beacon): initialize them first. */ + static const char *const aszSucc[] = { "mod_watchdog.c", NULL}; /* manager handler */ APR_REGISTER_OPTIONAL_FN(balancer_manage); ap_hook_post_config(balancer_post_config, aszPred2, NULL, APR_HOOK_MIDDLE); ap_hook_pre_config(balancer_pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(balancer_handler, NULL, NULL, APR_HOOK_FIRST); - ap_hook_child_init(balancer_child_init, aszPred, NULL, APR_HOOK_MIDDLE); + ap_hook_child_init(balancer_child_init, aszPred, aszSucc, APR_HOOK_MIDDLE); proxy_hook_pre_request(proxy_balancer_pre_request, NULL, NULL, APR_HOOK_FIRST); proxy_hook_post_request(proxy_balancer_post_request, NULL, NULL, APR_HOOK_FIRST); proxy_hook_canon_handler(proxy_balancer_canon, NULL, NULL, APR_HOOK_FIRST);