Log Message: |
mpm_event: Fix accounting of active/total processes on ungraceful restart.
Children processes terminated by ap_{reclaim,relieve}_child_processes() were
were not un-accounted for total_daemons and active_daemons, which was done in
server_main_loop() only. This led to perform_idle_server_maintenance() thinking
it was over the limit of children processes and never create new ones.
Have this accounting right in event_note_child_{started,stopped}() which is
called both at runtime and reload time.
* server/mpm/event/event.c(struct event_retained_data):
Rename field max_daemons_limit to max_daemon_used to better describe what
it's about and to align with AP_MPMQ_MAX_DAEMON_USED.
* server/mpm/event/event.c(event_note_child_stopped):
Renamed from event_note_child_killed() to clarify that it's not only called
when a child is killed (i.e. on restart) but whenever a child has stopped.
* server/mpm/event/event.c(event_note_child_stopped):
Move decrementing {active,total}_daemons and marking child's threads as
SERVER_DEAD from server_main_loop() so that it's done both at runtime and
reload time. Log the current number/state of daemons at APLOG_DEBUG level
for each child stopped.
* server/mpm/event/event.c(event_note_child_started):
Move incrementing {active,total}_daemons from make_child() for symmetry,
given that make_child() calls event_note_child_started(). Log the current
number/state of daemons at APLOG_DEBUG level for each child started.
* server/mpm/event/event.c(perform_idle_server_maintenance):
Fix possible miscounting of retained->max_daemon_used accross the multiple
calls to perform_idle_server_maintenance() if ListenCoresBucketsRatio > 0.
Pass an int *max_daemon_used which starts at zero and is bumped consistently
for all the buckets, while retained->max_daemon_used is updated only after
all the buckets have been maintained.
* server/mpm/event/event.c(perform_idle_server_maintenance):
Use event_note_child_stopped() to handle exited children processes.
Fixes: BZ 66004
|