[jifty-devel] MySQL: Transparent reconnect

Thomas Themel themel at blackwhale.net
Tue Sep 5 04:31:35 EDT 2006


my Jifty web application has now been deployed, and because it's a small
application used infrequently by only a few people, I get a lot of MySQL
timeouts. Jifty reacts to this by logging 

[Tue Sep 05 10:18:29 2006] [error] [client] FastCGI:
server "/home/www/ql.themel.com/bin/jifty" stderr: DBD::mysql::st execute 
failed: MySQL server has gone away at 
/usr/local/share/perl/5.8.4/Jifty/DBI/Handle.pm line 468.

DBD::mysql actually has a transparent reconnect feature that it disables
by default, unless the environment variables MOD_PERL or
GATEWAY_INTERFACE are set. It can be turned on by setting
$db->{mysql_auto_reconnect} = 1 ; It would be really useful for me to
have this in Jifty. After a quick look at the source, I didn't see an
obvious hook to change the initialization of Jifty::DBI::Handle::mysql
objects, and so I thought I'd ask whether

- Jifty should set GATEWAY_INTERFACE, at least in fastcgi mode?
- it would be a good idea to add handle-specific connect or new methods?

[*Thomas  Themel*] I just want an EDitor!! Not a "viitor". Not a "emacsitor".
[extended contact] Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!
[info provided in]
[*message header*] Paul J. LoPresti in <1991Jul11.031731.9260 at athena.mit.edu>

More information about the jifty-devel mailing list