Received: by taz.hyperreal.com (8.8.4/V2.0) id HAA11323; Sat, 25 Jan 1997 07:38:04 -0800 (PST) Received: from sierra.zyzzyva.com by taz.hyperreal.com (8.8.4/V2.0) with ESMTP id HAA11318; Sat, 25 Jan 1997 07:38:00 -0800 (PST) Received: from sierra (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.8.4/8.8.2) with ESMTP id JAA07183 for ; Sat, 25 Jan 1997 09:43:17 -0600 (CST) Message-Id: <199701251543.JAA07183@sierra.zyzzyva.com> To: new-httpd@hyperreal.com Subject: Re: [PATCH] make_child and SERVER_STARTING forever In-reply-to: fielding's message of Fri, 24 Jan 1997 20:24:48 -0800. <9701242025.aa04814@paris.ics.uci.edu> X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 25 Jan 1997 09:43:17 -0600 From: Randy Terbush Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com +1 > I'd like to apply this as well, but I can't until I can commit > the other patch to http_main.c. > > .....Roy > > Date: Wed, 15 Jan 1997 16:44:55 -0500 > From: Phillip Vandry > To: apache-bugs@apache.org > Subject: Bug report > > We operate a fairly large Apache server (half a million hits per day) > under Solaris 2.5 and we are experiencing hanging problems, where the > server will occasionally block, and connections are accepted, but no > requests are processed for 40 or 50 seconds or more. > > I think the following bug is part of the problem, but not all of it. > > If a child fails to initialize and craps out, it will be reaped by the > main process and the scoreboard will be updated to SERVER_DEAD. But > if the fork() in make_child() fails, the scoreboard will continue > to say SERVER_STARTING forever. Eventually, the main process will > 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. > > Thanks. > -Phil > > *** http_main.c 1997/01/09 15:14:53 1.2 > --- http_main.c 1997/01/15 21:30:09 > *************** > *** 1675,1681 **** > } > } > > ! void make_child(server_rec *server_conf, int child_num) > { > int pid; > > --- 1675,1681 ---- > } > } > > ! int make_child(server_rec *server_conf, int child_num) > { > int pid; > > *************** > *** 1693,1699 **** > over and over again. */ > sleep(10); > > ! return; > } > > if (!pid) { > --- 1693,1699 ---- > over and over again. */ > sleep(10); > > ! return -1; > } > > if (!pid) { > *************** > *** 1701,1706 **** > --- 1701,1707 ---- > signal (SIGTERM, (void (*)())just_die); > child_main (child_num); > } > + return 0; > } > > static int > *************** > *** 1974,1980 **** > 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); > > } > > --- 1975,1986 ---- > 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_STRATING forever and ever */ > ! (void)update_child_status(child_slot,SERVER_DEAD, > ! (request_rec*)NULL); > ! } > > }