You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2005/11/29 03:16:45 UTC
DO NOT REPLY [Bug 37680] New: -
If num listening sockets drops to one on restart/graceful, httpd jams with 100% CPU
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37680>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37680
Summary: If num listening sockets drops to one on
restart/graceful, httpd jams with 100% CPU
Product: Apache httpd-2.0
Version: 2.0.55
Platform: All
OS/Version: Linux
Status: NEW
Severity: critical
Priority: P3
Component: Core
AssignedTo: bugs@httpd.apache.org
ReportedBy: darius-abz@free-range.com.au
Apache httpd consumes 100% CPU and does not respond to requests if at some stage
of execution it has more than one listening socket configured, then it is
subsequently reconfigured by "apachectl restart" or "apachectl graceful" to have
only one listening socket, where that socket corresponds to one of the
previously existing sockets. The problem is that the O_NONBLOCK option has been
set on the reused socket in the previous initialisation, and a later part of the
code expects to make a blocking "accept" call on that socket (e.g.
server/mpm/prefork/prefork.c:591). The call returns EWOULDBLOCK/EAGAIN where
that case is not specifically handled, causing a loop in the MPM (e.g. at
server/mpm/prefork/prefork.c:522) with full CPU utilisation.
The fix is to clear the O_NONBLOCK option on the reused socket if there is only
the one listening socket. A patch to server/listen.c will be attached shortly.
Steps to reproduce:
$ tar xjf httpd-2.0.55.tar.bz2
$ cd httpd-2.0.55/
$ ./configure --prefix=/home/username/apache2-test
$ make
$ make install
$ cd /home/username/apache2-test
$ vi conf/httpd.conf
Change "Listen 80" to "Listen 10080" (on the assumption that we're using an
unprivileged account; this does not affect the reproducabililty of the bug).
$ bin/apachectl start
Browse to localhost:10080, and verify that the server is working (receive the
default installation page).
$ vi conf/httpd.conf
Add "Listen 10081" on a new line after the existing line "Listen 10080"
$ bin/apachectl restart
Browse to localhost:10081, and verify that the server is working.
localhost:10080 is still working too.
$ vi conf/httpd.conf
Delete the line "Listen 10081".
$ bin/apachectl restart
$ top
Browse to localhost:10080.
Expected results:
Normal CPU utilisation. Apache should serve the default installation page on
localhost:10080.
Actual results:
100% CPU utilisation, shared amongst the five httpd child processes. Apache
does not serve anything on any port.
Problem reproduced on:
Apache 2.0.54 and 2.0.55 on i686 Fedora Core 3 Linux kernel 2.6.12-1.1378_FC3
Apache 2.0.55 on Linux kernel 2.4.20, PowerPC MPC8555 CPU.
Completely reproducible. Only the "prefork" MPM has been tested, but I would
expect that similar results (or other failures) may occur with other MPMs.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org