--- /dev/null
+ *) mpm_event: kill connections in keepalive state only when there is no more
+ workers available, not when the maximum number of connections is reached,
+ restoring prior to 2.4.30 behaviour. [Yann Ylavic]
+
return apr_atomic_read32(&listensocks_disabled);
}
-static APR_INLINE int connections_above_limit(void)
+static APR_INLINE int connections_above_limit(int *busy)
{
apr_uint32_t i_count = ap_queue_info_num_idlers(worker_queue_info);
if (i_count > 0) {
return 0;
}
}
+ else if (busy) {
+ *busy = 1;
+ }
return 1;
}
is_last_connection = !apr_atomic_dec32(&connection_count);
if (listener_is_wakeable
&& ((is_last_connection && listener_may_exit)
- || (listeners_disabled() && !connections_above_limit()))) {
+ || (listeners_disabled() && !connections_above_limit(NULL)))) {
apr_pollset_wakeup(event_pollset);
}
return APR_SUCCESS;
"All workers busy, not accepting new conns "
"in this process");
}
- else if (connections_above_limit()) {
+ else if (connections_above_limit(&workers_were_busy)) {
disable_listensocks();
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
APLOGNO(03269)
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
"Idle workers: %u",
ap_queue_info_num_idlers(worker_queue_info));
- workers_were_busy = 1;
}
else if (!listener_may_exit) {
void *csd = NULL;
if (listeners_disabled()
&& !workers_were_busy
- && !connections_above_limit()) {
+ && !connections_above_limit(NULL)) {
enable_listensocks();
}
} /* listener main loop */