[core] re-enable overloaded backends w/ multi wkrs
re-enable overloaded backends when server.max-worker is non-zero
(thx jens-maus)
x-ref:
"mod_proxy not re-enabling proxy with 1.4.48" (multiple workers)
@@ -2488,17 +2488,31 @@ static void gw_handle_trigger_exts(server *srv, gw_exts *exts, int debug) {
}
}
+static void gw_handle_trigger_exts_wkr(server *srv, gw_exts *exts) {
+ for (size_t j = 0; j < exts->used; ++j) {
+ gw_extension * const ex = exts->exts[j];
+ for (size_t n = 0; n < ex->used; ++n) {
+ gw_host * const host = ex->hosts[n];
+ for (gw_proc *proc = host->first; proc; proc = proc->next) {
+ if (proc->state == PROC_STATE_OVERLOADED)
+ gw_proc_check_enable(srv, host, proc);
+ }
+ }
+ }
+}
+
handler_t gw_handle_trigger(server *srv, void *p_d) {
gw_plugin_data *p = p_d;
- if (0 != srv->srvconf.max_worker && p->srv_pid != srv->pid)
- return HANDLER_GO_ON;
+ int wkr = (0 != srv->srvconf.max_worker && p->srv_pid != srv->pid);
for (size_t i = 0; i < srv->config_context->used; i++) {
gw_plugin_config *conf = p->config_storage[i];
gw_exts *exts = conf->exts;
int debug = conf->debug ? conf->debug : p->config_storage[0]->debug;
if (NULL == exts) continue;
- gw_handle_trigger_exts(srv, exts, debug);
+ wkr
+ ? gw_handle_trigger_exts_wkr(srv, exts)
+ : gw_handle_trigger_exts(srv, exts, debug);
}
return HANDLER_GO_ON;
