On Wed, Sep 01, 2010 at 09:41:03PM +0100, Dominic Hargreaves wrote:
> Investigating this line. I've reproduced the problem (without parallel
> booting, just with a simple
>
> /etc/init.d/apache2 stop; /etc/init.d/mysql stop; /etc/init.d/apache2 start
>
> and the same problem occurs with postgres. When I tried to reproduce
> with sqlite, by chmodding 0 the database file, Apache successfully
> started up.
>
> Need more analysis before forwarding upstream.
I've raised this upstream:
<http://lists.bestpractical.com/pipermail/rt-devel/2010-September/011169.html>
and then at the mod_perl users' list (copy attached; it hasn't made it
through to the list yet).
In the absence of any better suggestions I think I will try and prepare
a rough and ready patch whereby the webmux.pl script retries for a short
while (1 minute) to connect to the database, and then gives up.
If anyone reading has any other good ideas, please let me know.
Cheers,
Dominic.
--
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
--- Begin Message ---
Hello,
I'm currently trying to work around a problem reported in Debian[0]
whereby, due to parallel booting, the database server required by
a mod_perl application (RT) is not available by the time the web
server (Apache) has started. A similar situation would arise when a
remote database server is down, or there are network problems.
The application developers are firm[1] that the database connection is
needed at application startup time, so restructuring the code so the
startup script is not dependent on the database server seems impractical.
Equally, any attempt to enforce ordering in the database/web server
startup in Debian is unlikely to be possible or desirable, at least in
the short term[2][3] (and that wouldn't really solve the problem for
remote database servers).
So I'm left with the option of either deprecating support for RT with
mod_perl, patching RT to sit in a loop retrying the database connection
for some fixed time (1 minute?) or finding a way for mod_perl to help.
The other main method of running RT -- FastCGI -- doesn't suffer from
this problem, because both mod_fastcgi and mod_fcgid have a retry-with
backoff functionality when starting up external applications, and while
this is happening, the web server is otherwise fully functional. I'm
not familiar with the internals of mod_perl, and I'm aware it might be
a long shot, but is there any way I can get the same effect with
mod_perl, or some other way to fix the issue which I haven't thought of?
Thanks,
Dominic.
[0] <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595054>
[1]
<http://lists.bestpractical.com/pipermail/rt-devel/2010-September/011169.html>
[2] <http://lists.debian.org/debian-devel/2010/08/msg00786.html>
[3] <http://lists.debian.org/debian-devel/2010/09/msg00011.html]
--
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
--- End Message ---