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/prefork prefork.c
Date Sun, 28 Jan 2001 01:16:37 GMT
rbb         01/01/27 17:16:37

  Modified:    .        CHANGES
               server   mpm_common.c
               server/mpm/prefork prefork.c
  Log:
  Make the Prefork MPM use SIGWINCH instead of SIGUSR1 for graceful restarts.
  
  Revision  Changes    Path
  1.58      +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -d -b -w -u -r1.57 -r1.58
  --- CHANGES	2001/01/27 21:28:25	1.57
  +++ CHANGES	2001/01/28 01:16:36	1.58
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0b1
   
  +  *) Change the Prefork MPM to use SIGWINCH instead of SIGUSR1 for graceful
  +     restarts.  [Ryan Bloom]
  +
     *) Modify the apr_stat/lstat/getfileinfo calls within apache to use
        the most optimal APR_FINFO_wanted bits.  This spares Win32 from
        performing very expensive owner, group and permission lookups
  
  
  
  1.38      +1 -1      httpd-2.0/server/mpm_common.c
  
  Index: mpm_common.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -d -b -w -u -r1.37 -r1.38
  --- mpm_common.c	2001/01/21 14:52:12	1.37
  +++ mpm_common.c	2001/01/28 01:16:36	1.38
  @@ -229,7 +229,7 @@
           switch (WTERMSIG(status)) {
           case SIGTERM:
           case SIGHUP:
  -        case SIGUSR1:
  +        case SIGWINCH:
           case SIGKILL:
               break;
           default:
  
  
  
  1.147     +20 -20    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.146
  retrieving revision 1.147
  diff -u -d -b -w -u -r1.146 -r1.147
  --- prefork.c	2001/01/27 21:28:28	1.146
  +++ prefork.c	2001/01/28 01:16:37	1.147
  @@ -157,7 +157,7 @@
   
   /*
    * The max child slot ever assigned, preserved across restarts.  Necessary
  - * to deal with MaxClients changes across SIGUSR1 restarts.  We use this
  + * to deal with MaxClients changes across SIGWINCH restarts.  We use this
    * value to optimize routines that have to scan the entire scoreboard.
    */
   int ap_max_daemons_limit = -1;
  @@ -635,7 +635,7 @@
   	return;
       }
       restart_pending = 1;
  -    if ((is_graceful = (sig == SIGUSR1))) {
  +    if ((is_graceful = (sig == SIGWINCH))) {
           apr_kill_cleanup(pconf, NULL, cleanup_shared_mem);
       }
   }
  @@ -698,14 +698,14 @@
   	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
   #endif
   
  -    /* we want to ignore HUPs and USR1 while we're busy processing one */
  +    /* we want to ignore HUPs and WINCH while we're busy processing one */
       sigaddset(&sa.sa_mask, SIGHUP);
  -    sigaddset(&sa.sa_mask, SIGUSR1);
  +    sigaddset(&sa.sa_mask, SIGWINCH);
       sa.sa_handler = restart;
       if (sigaction(SIGHUP, &sa, NULL) < 0)
   	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
  -    if (sigaction(SIGUSR1, &sa, NULL) < 0)
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGUSR1)");
  +    if (sigaction(SIGWINCH, &sa, NULL) < 0)
  +	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
   #else
       if (!one_process) {
   	apr_signal(SIGSEGV, sig_coredump);
  @@ -733,9 +733,9 @@
   #ifdef SIGHUP
       apr_signal(SIGHUP, restart);
   #endif /* SIGHUP */
  -#ifdef SIGUSR1
  -    apr_signal(SIGUSR1, restart);
  -#endif /* SIGUSR1 */
  +#ifdef SIGWINCH
  +    apr_signal(SIGWINCH, restart);
  +#endif /* SIGWINCH */
   #ifdef SIGPIPE
       apr_signal(SIGPIPE, SIG_IGN);
   #endif /* SIGPIPE */
  @@ -812,11 +812,11 @@
   
       while (!ap_graceful_stop_signalled()) {
   
  -	/* Prepare to receive a SIGUSR1 due to graceful restart so that
  +	/* Prepare to receive a SIGWINCH due to graceful restart so that
   	 * we can exit cleanly.
   	 */
   	usr1_just_die = 1;
  -	apr_signal(SIGUSR1, usr1_handler);
  +	apr_signal(SIGWINCH, usr1_handler);
   
   	/*
   	 * (Re)initialize this child to a pre-connection state.
  @@ -1018,7 +1018,7 @@
   	 * the signal to ignore because we don't want to disturb any
   	 * third party code.
   	 */
  -	apr_signal(SIGUSR1, SIG_IGN);
  +	apr_signal(SIGWINCH, SIG_IGN);
   	/*
   	 * We now have a connection, so set it up with the appropriate
   	 * socket options, file descriptors, and read/write buffers.
  @@ -1118,7 +1118,7 @@
   	 * requested there's no race condition here.
   	 */
   	apr_signal(SIGHUP, just_die);
  -	apr_signal(SIGUSR1, just_die);
  +	apr_signal(SIGWINCH, just_die);
   	apr_signal(SIGTERM, just_die);
   	child_main(slot);
       }
  @@ -1223,11 +1223,11 @@
       }
       ap_max_daemons_limit = last_non_dead + 1;
       if (idle_count > ap_daemons_max_free) {
  -	/* kill off one child... we use SIGUSR1 because that'll cause it to
  +	/* kill off one child... we use SIGWINCH because that'll cause it to
   	 * shut down gracefully, in case it happened to pick up a request
   	 * while we were counting
   	 */
  -	kill(ap_scoreboard_image->parent[to_kill].pid, SIGUSR1);
  +	kill(ap_scoreboard_image->parent[to_kill].pid, SIGWINCH);
   	idle_spawn_rate = 1;
       }
       else if (idle_count < ap_daemons_min_free) {
  @@ -1359,7 +1359,7 @@
   
       /* If we're doing a graceful_restart then we're going to see a lot
   	* of children exiting immediately when we get into the main loop
  -	* below (because we just sent them SIGUSR1).  This happens pretty
  +	* below (because we just sent them SIGWINCH).  This happens pretty
   	* rapidly... and for each one that exits we'll start a new one until
   	* we reach at least daemons_min_free.  But we may be permitted to
   	* start more than that, so we'll just keep track of how many we're
  @@ -1486,7 +1486,7 @@
   
       /* we've been told to restart */
       apr_signal(SIGHUP, SIG_IGN);
  -    apr_signal(SIGUSR1, SIG_IGN);
  +    apr_signal(SIGWINCH, SIG_IGN);
       if (one_process) {
   	/* not worth thinking about */
   	return 1;
  @@ -1505,11 +1505,11 @@
   	int i;
   #endif
   	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
  -		    "SIGUSR1 received.  Doing graceful restart");
  +		    "SIGWINCH received.  Doing graceful restart");
   
   	/* kill off the idle ones */
  -	if (unixd_killpg(getpgrp(), SIGUSR1) < 0) {
  -	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGUSR1");
  +	if (unixd_killpg(getpgrp(), SIGWINCH) < 0) {
  +	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGWINCH");
   	}
   #ifndef SCOREBOARD_FILE
   	/* This is mostly for debugging... so that we know what is still
  
  
  

Mime
View raw message