[mod_python] Re: apachectl restart == dead mod_python

The Doctor What list.mod_python at docwhat.gerf.org
Fri Sep 9 10:57:58 EDT 2005


* Graham Dumpleton (grahamd at dscpl.com.au) [050908 21:06]:
> 
> On 09/09/2005, at 11:43 AM, The Doctor What wrote:
> 
> >Hello!
> >
> >I have apache2 2.0.54, mod_python 3.1.3, python 2.3.5 (Debian
> >Sarge).
> >
> >I can start up apache2 and the mod_python pages work fine.
> >
> >However, if I then do apachectl restart, the mod_python pages hang
> >forever.  Frozen.  Eventually I get a timeout message in my browser.
> >The apache children do not die readily and require extra time to
> >clean up. :-(
> >
> >I full stop/start works everytime but in not a desirable solution
> >for a live server with multiple domains.  In addition, I'd have to
> >change all the log rotation stuff, etc.
> >
> >I particularly interested in TRAC, but it seems to be a generic
> >problem. I want to get PSE on my server, too.
> >
> >Is there some option I'm not including or something?
> 
> Is this happening with a really simple mod_python handler, ie.,
> something like mptest, or something more complicated? Ie., can
> you be sure it isn't the handler code itself is causing the
> problem?
> 
> What mode is Apache running in, "prefork" or "worker"?
> 
> Do you get any messages in the Apache error log file which may be
> pertinent?

Hi Graham! Thanks for replying. :-)

I set up the mptest.py and got the following behaviour:
  * After setting up the configuration directives, I did a complete
    restart (stop-start). The mptest.py worked correctly.
  * I then did a reload (kill -HUP aka graceful) on apache.
    mptest.py then returned 500s for the first few times, then the
    apache server stopped responding to that page. Other pages work
    fine.  No logs are generated other than access logs.
  * To recover, a full restart is needed (stop-start).  It takes
    work to kill some of the children.  It's obvious that they
    are hung somehow.

See the attached file "experiment" for a full log of my tests.

The apache server is running in "prefork" mode.

Ciao!
-------------- next part --------------
Script started on Fri Sep  9 09:38:53 2005
docwhat % sudo /etc/init.d/apache2 restart
Forcing reload of web server: Apache2.
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
docwhat % sudo /etc/init.d/apache2 reload
Reloading web server config...done.
docwhat % lynx -source http://gerf.org/test/mptest.py
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Server error!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Server error!</h1>
<p>


  

    The server encountered an internal error and was 
    unable to complete your request. Either the server is
    overloaded or there was an error in a CGI script.

  

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.

</p>

<h2>Error 500</h2>
<address>
  <a href="/">gerf.org</a><br />
  
  <span>Fri Sep  9 09:39:58 2005<br />
  Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_fastcgi/2.4.2 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e</span>
</address>
</body>
</html>

docwhat % lynx -source http://gerf.org/test/mptest.py
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Server error!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Server error!</h1>
<p>


  

    The server encountered an internal error and was 
    unable to complete your request. Either the server is
    overloaded or there was an error in a CGI script.

  

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.

</p>

<h2>Error 500</h2>
<address>
  <a href="/">gerf.org</a><br />
  
  <span>Fri Sep  9 09:39:59 2005<br />
  Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_fastcgi/2.4.2 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e</span>
</address>
</body>
</html>

docwhat % lynx -source http://gerf.org/test/mptest.py
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Server error!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Server error!</h1>
<p>


  

    The server encountered an internal error and was 
    unable to complete your request. Either the server is
    overloaded or there was an error in a CGI script.

  

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.

</p>

<h2>Error 500</h2>
<address>
  <a href="/">gerf.org</a><br />
  
  <span>Fri Sep  9 09:40:00 2005<br />
  Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_fastcgi/2.4.2 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e</span>
</address>
</body>
</html>

docwhat % lynx -source http://gerf.org/test/mptest.py
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Server error!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Server error!</h1>
<p>


  

    The server encountered an internal error and was 
    unable to complete your request. Either the server is
    overloaded or there was an error in a CGI script.

  

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.

</p>

<h2>Error 500</h2>
<address>
  <a href="/">gerf.org</a><br />
  
  <span>Fri Sep  9 09:40:01 2005<br />
  Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_fastcgi/2.4.2 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e</span>
</address>
</body>
</html>

docwhat % lynx -source http://gerf.org/test/mptest.py

docwhat % echo I pressed control c, it never came back.
I pressed control c, it never came back.
docwhat % sudo /etc/init.d/apache2 stop
Stopping web server: Apache2.
docwhat % sudo /etc/init.d/apache2 stop
Stopping web server: Apache2 ... no pidfile found! not running?.
docwhat % sudo /etc/init.d/apache2 start
Starting web server: Apache2.
docwhat % lynx -source http://gerf.org/test/mptest.py
Hello World!
Script done on Fri Sep  9 09:45:58 2005


More information about the Mod_python mailing list