Re: MySQL server has gone away?

[prev] [thread] [next] [Date index for 2005/04/10]

From: Bas Schulte
Subject: Re: MySQL server has gone away?
Date: 23:18 on 10 Apr 2005
Hi Philip,

On zondag, apr 10, 2005, at 22:42 Europe/Amsterdam, Philip M. Gollucci 
wrote:

> The auto_reconnect behavior was changed in DBD::mysql or DBI recently 
> (< 6 months ago)...  I forget from/to.. Read the Changes of each.

There's some info in DBD::mysql. Further investigation tells me this 
might have at least something to do with it. When the apache children 
pre-connect, the db handles have the 'mysql_auto_reconnect' set to 1 
(it checks $ENV{MOD_PERL} and sets it to 1. However, the db handles 
that my script fetch (which should have been the same ones that were 
created during child creation, I do Apache::DBI->connect_on_init in 
startup.pl), no longer have that attribute set to 1, but set to 0.

The same check on the current version of my application gives me 1 for 
the mysql_auto_reconnect...

Ok, just installed DBD-mysql-2.9006 instead of DBD-mysql-2.9004, now 
the flag is set to 1, which is what I'd expect.

So the scenario with 2.9004 that I saw is: the mysql_auto_reconnect 
flag gets set to 1 during child creation correctly, but my webapps get 
a (cached) db handle from Apache::DBI with that flag set to 0. During 
the night the known "MySQL morning bug" happens: MySQL has dropped the 
connection because of idle time, and there's my "MySQL server has gone 
away" problem.

Thanks for pointing me in the right direction! I'm pretty sure this is 
what was happening, with 2.9006, the problem should be gone.

Regards,

Bas.

MySQL server has gone away?
Bas Schulte 08:25 on 10 Apr 2005

Re: MySQL server has gone away?
harm 08:53 on 10 Apr 2005

Re: MySQL server has gone away?
Bas Schulte 09:59 on 10 Apr 2005

Re: MySQL server has gone away?
Bas Schulte 23:18 on 10 Apr 2005

Generated at 12:49 on 16 Apr 2005 by mariachi v0.52