brian 96/10/31 09:51:37
Modified: src http_main.c Log: Reviewed by: Dirk vanGulik, Brian Behlendorf Submitted by: Sameer Parekh Introduced a sleep() if the fork() call fails, to prevent apache from running away with the CPU in case the process table fills up. Revision Changes Path 1.80 +7 -1 apache/src/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.79 retrieving revision 1.80 diff -C3 -r1.79 -r1.80 *** http_main.c 1996/10/23 13:28:17 1.79 --- http_main.c 1996/10/31 17:51:35 1.80 *************** *** 50,56 **** * */ ! /* $Id: http_main.c,v 1.79 1996/10/23 13:28:17 mjc Exp $ */ /* * httpd.c: simple http daemon for answering WWW file requests --- 50,56 ---- * */ ! /* $Id: http_main.c,v 1.80 1996/10/31 17:51:35 brian Exp $ */ /* * httpd.c: simple http daemon for answering WWW file requests *************** *** 1583,1588 **** --- 1583,1594 ---- if ((pid = fork()) == -1) { log_unixerr("fork", NULL, "Unable to fork new process", server_conf); + + /* In case system resources are maxxed out, we don't want + Apache running away with the CPU trying to fork over and + over and over again. */ + sleep(10); + return; }