fielding    97/01/25 12:28:21

  Modified:    src       CHANGES http_main.c
  Log:
  Fixed condition where, if a child fails to fork, the scoreboard would
  continue to say SERVER_STARTING forever. Eventually, the main process
  would refuse to start new children because count_idle_servers() will
  count those SERVER_STARTING entries and will always report that there
  are enough idle servers.
  
  Submitted by: Phillip Vandry <[EMAIL PROTECTED]>
  Reviewed by: Roy Fielding, Marc Slemko, Chuck Murcko, Randy Terbush
  
  Revision  Changes    Path
  1.133     +6 -0      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -C3 -r1.132 -r1.133
  *** CHANGES   1997/01/25 20:12:48     1.132
  --- CHANGES   1997/01/25 20:28:17     1.133
  ***************
  *** 106,111 ****
  --- 106,117 ----
         select, and removed potential for infinite loop in accept.
         [Roy Fielding, after useful PR from [EMAIL PROTECTED]
    
  +   *) Fixed condition where, if a child fails to fork, the scoreboard would
  +      continue to say SERVER_STARTING forever. Eventually, the main process
  +      would refuse to start new children because count_idle_servers() will
  +      count those SERVER_STARTING entries and will always report that there
  +      are enough idle servers. [Phillip Vandry]
  + 
    Changes with Apache 1.2b4:
    
      *) Fix possible race condition in accept_mutex_init() that
  
  
  
  1.112     +9 -3      apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -C3 -r1.111 -r1.112
  *** http_main.c       1997/01/25 20:12:49     1.111
  --- http_main.c       1997/01/25 20:28:19     1.112
  ***************
  *** 1715,1721 ****
        }    
    }
    
  ! void make_child(server_rec *server_conf, int child_num)
    {
        int pid;
    
  --- 1715,1721 ----
        }    
    }
    
  ! int make_child(server_rec *server_conf, int child_num)
    {
        int pid;
    
  ***************
  *** 1733,1739 ****
               over and over again. */
        sleep(10);
    
  !     return;
        } 
        
        if (!pid) {
  --- 1733,1739 ----
               over and over again. */
        sleep(10);
    
  !     return -1;
        } 
        
        if (!pid) {
  ***************
  *** 1741,1746 ****
  --- 1741,1747 ----
        signal (SIGTERM, (void (*)())just_die);
        child_main (child_num);
        }
  +     return 0;
    }
    
    static int
  ***************
  *** 2014,2020 ****
            Explain1("Starting new child in slot %d",child_slot);
            (void)update_child_status(child_slot,SERVER_STARTING,
             (request_rec*)NULL);
  !         make_child(server_conf, child_slot);
    
        }
    
  --- 2015,2026 ----
            Explain1("Starting new child in slot %d",child_slot);
            (void)update_child_status(child_slot,SERVER_STARTING,
             (request_rec*)NULL);
  !         if (make_child(server_conf, child_slot) < 0) {
  !             /* fork didn't succeed. Fix the scoreboard or else
  !                it will say SERVER_STARTING forever and ever */
  !             (void)update_child_status(child_slot,SERVER_DEAD,
  !                  (request_rec*)NULL);
  !         }
    
        }
    
  
  
  

Reply via email to