httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Fri, 10 Aug 2001 05:00:27 GMT
rbb         01/08/09 22:00:27

  Modified:    .        CHANGES
               server/mpm/worker worker.c
  Log:
  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.
  
  Revision  Changes    Path
  1.286     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.285
  retrieving revision 1.286
  diff -u -r1.285 -r1.286
  --- CHANGES	2001/08/09 15:56:20	1.285
  +++ CHANGES	2001/08/10 05:00:27	1.286
  @@ -1,5 +1,10 @@
   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]
  
  
  
  1.11      +5 -22     httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- worker.c	2001/08/10 01:34:11	1.10
  +++ worker.c	2001/08/10 05:00:27	1.11
  @@ -505,7 +505,6 @@
   /* 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) {
  @@ -679,14 +678,8 @@
       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;
   }
  @@ -704,6 +697,9 @@
   
       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--;
  @@ -714,20 +710,7 @@
       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;
  
  
  

Mime
View raw message