httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/prefork prefork.c
Date Fri, 14 Jun 2002 03:11:43 GMT
trawick     2002/06/13 20:11:43

  Modified:    .        CHANGES
               server/mpm/prefork prefork.c
  Log:
  prefork MPM: Ignore mutex errors during graceful restart.  For
  certain types of mutexes (particularly SysV semaphores), we
  should expect to occasionally fail to obtain or release the
  mutex during restart processing.
  
  These mutex failures seem to be a pretty rare occurrence, but
  it was fatal.
  
  Revision  Changes    Path
  1.827     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.826
  retrieving revision 1.827
  diff -u -r1.826 -r1.827
  --- CHANGES	13 Jun 2002 18:46:28 -0000	1.826
  +++ CHANGES	14 Jun 2002 03:11:42 -0000	1.827
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.38
   
  +  *) prefork MPM: Ignore mutex errors during graceful restart.  For
  +     certain types of mutexes (particularly SysV semaphores), we
  +     should expect to occasionally fail to obtain or release the
  +     mutex during restart processing.  [Jeff Trawick]
  +
     *) Fix install-bindist.sh so that it finds any perl instead of just
        early perl 5.x versions.  This is consistent with a build/install
        from source, and it allows the perl scripts installed by a bindist 
  
  
  
  1.267     +26 -5     httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.266
  retrieving revision 1.267
  diff -u -r1.266 -r1.267
  --- prefork.c	7 Jun 2002 14:08:05 -0000	1.266
  +++ prefork.c	14 Jun 2002 03:11:43 -0000	1.267
  @@ -172,6 +172,7 @@
   #ifndef MULTITHREAD
   static int my_child_num;
   #endif
  +ap_generation_t volatile ap_my_generation=0;
   
   #ifdef TPF
   int tpf_child = 0;
  @@ -239,8 +240,17 @@
   {
       apr_status_t rv = apr_proc_mutex_lock(accept_mutex);
       if (rv != APR_SUCCESS) {
  -        ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "couldn't grab the accept mutex");
  -        exit(APEXIT_CHILDFATAL);
  +        const char *msg = "couldn't grab the accept mutex";
  +
  +        if (ap_my_generation != 
  +            ap_scoreboard_image->global->running_generation) {
  +            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, msg);
  +            clean_child_exit(0);
  +        }
  +        else {
  +            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, msg);
  +            exit(APEXIT_CHILDFATAL);
  +        }
       }
   }
   
  @@ -248,8 +258,20 @@
   {
       apr_status_t rv = apr_proc_mutex_unlock(accept_mutex);
       if (rv != APR_SUCCESS) {
  -        ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "couldn't release the accept mutex");
  -        exit(APEXIT_CHILDFATAL);
  +        const char *msg = "couldn't release the accept mutex";
  +
  +        if (ap_my_generation != 
  +            ap_scoreboard_image->global->running_generation) {
  +            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, msg);
  +            /* don't exit here... we have a connection to
  +             * process, after which point we'll see that the
  +             * generation changed and we'll exit cleanly
  +             */
  +        }
  +        else {
  +            ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, msg);
  +            exit(APEXIT_CHILDFATAL);
  +        }
       }
   }
   
  @@ -364,7 +386,6 @@
   static int volatile shutdown_pending;
   static int volatile restart_pending;
   static int volatile is_graceful;
  -ap_generation_t volatile ap_my_generation=0;
   
   static void sig_term(int sig)
   {
  
  
  

Mime
View raw message