Changes with Apache 2.0.24-dev
+ *) The worker MPM now handles shutdown and restart requests. It
+ definately isn't perfect, but we do stop the servers correctly.
+ The biggest problem right now is that SIGHUP causes the server to
+ just die. [Ryan Bloom]
+
Changes with Apache 2.0.23
*) Use the prefork MPM by default on Unix. [various]
/* requests_this_child has gone to zero or below. See if the admin coded
"MaxRequestsPerChild 0", and keep going in that case. Doing it this way
simplifies the hot path in worker_thread */
-
static void check_infinite_requests(void)
{
if (ap_max_requests_per_child) {
ap_update_child_status(process_slot, thread_slot, (dying) ? SERVER_DEAD : SERVER_GRACEFUL,
(request_rec *) NULL);
dying = 1;
- apr_lock_acquire(worker_thread_count_mutex);
- worker_thread_count--;
- if (worker_thread_count == 0) {
- /* All the threads have exited, now finish the shutdown process
- * by signalling the sigwait thread */
- kill(ap_my_pid, SIGTERM);
- }
- apr_lock_release(worker_thread_count_mutex);
+ ap_scoreboard_image->parent[process_slot].quiescing = 1;
+ kill(ap_my_pid, SIGTERM);
return NULL;
}
while (!workers_may_exit) {
ap_queue_pop(worker_queue, &csd, &ptrans);
+ if (!csd) {
+ continue;
+ }
ap_increase_blanks(worker_queue);
process_socket(ptrans, csd, process_slot, thread_slot);
requests_this_child--;
ap_update_child_status(process_slot, thread_slot, (dying) ? SERVER_DEAD : SERVER_GRACEFUL,
(request_rec *) NULL);
apr_lock_acquire(worker_thread_count_mutex);
- if (!dying) {
- /* this is the first thread to exit */
- if (ap_my_pid == ap_scoreboard_image->parent[process_slot].pid) {
- /* tell the parent that it may use this scoreboard slot */
- ap_scoreboard_image->parent[process_slot].quiescing = 1;
- }
- dying = 1;
- }
worker_thread_count--;
- if (worker_thread_count == 0) {
- /* All the threads have exited, now finish the shutdown process
- * by signalling the sigwait thread */
- kill(ap_my_pid, SIGTERM);
- }
apr_lock_release(worker_thread_count_mutex);
return NULL;