Subject: | Connecting during startup causes random "Out of Sync"/"Lost connection" MySQL errors for subsequent per-process connections |
I've already discussed this on the mod_perl mailing list. The following
minimal mod_perl application works perfectly without Apache::DBI. As
soon as I add it to the mix and hammer the application with "ab -n 1000
-c 15" I'm getting a couple of "Lost connection to MySQL server" and
"Commands out of sync" errors from MySQL shortly after starting the
benchmark.
http://www.gossamer-threads.com/lists/modperl/modperl/97620#97620
If I use two different connection strings (e.g. with different
attributes) everything works with Apache::DBI. If I remove the connect
during startup, it works, too. In any case, the expected "skipping
connection during server startup" warning shows up but it seems that
when both connections (the one made during startup and the subsequent
connections during handler()) have identical DSNs and attributes
Apache::DBI re-uses the connection made during startup.
Due to the fact that nobody on the mod_perl list was able to help me I'm
filing this bug report and hope that I'm not doing something terribly
wrong that's causing these errors to crop up. I have a feeling that it's
caused by the global $dbh variable which would be a real problem because
our quite large (and somewhat outdated) Mason application relies on this :(