[Catalyst] Initial connection pool issue with CDBI and MySQL

Dylan Vanderhoof DylanV at semaphore.com
Sat Jan 28 01:40:56 CET 2006


I'm seeing some strange behavior on the first large chunk of requests
coming into Catalyst.

The environment is a single catalyst page that has a bunch of img tags
that call catalyst-handled dynamically generated images.

The first time the page is loaded, after an apache reload/restart, about
half the images fail to load.  A refresh loads all of them (none are
cached at any point), and all subsequent refreshes seem to work.



I'm seeing this error for some of the initial requests to the imagae
generator object:

[Fri Jan 27 16:33:44 2006] [catalyst] [error] Caught exception in
Application->auto "Application::Model::CDBI::Users can't SELECT me.id,
me.username, me.password
FROM   users me
WHERE  ( me.username = ? )
: DBD::mysql::st execute failed: Commands out of sync; you can't run
this command now [for Statement "SELECT me.id, me.username, me.password
FROM   users me
WHERE  ( me.username = ? )
"] at /usr/lib/perl5/vendor_perl/5.8.7/DBIx/ContextualFetch.pm line 51,
<DATA> line 1.
 at
/usr/lib/perl5/vendor_perl/5.8.7/Catalyst/Plugin/Authentication/Store/DB
IC/User.pm line 15"



The next few requests have the following error:

[Fri Jan 27 16:33:44 2006] [catalyst] [error] Caught exception in
Application::Controller::Grapher->check_rra_owner
"Application::Model::CDBI::Data can't SELECT me.id
FROM   data me
WHERE  ( me.id = ? )
: DBD::mysql::st execute failed: Lost connection to MySQL server during
query [for Statement "SELECT me.id
FROM   data me
WHERE  ( me.id = ? )
"] at /usr/lib/perl5/vendor_perl/5.8.7/DBIx/ContextualFetch.pm line 51.
 at /var/www/netresponse/lib/Application/Controller/Grapher.pm line 162"



Any ideas what might be happening?  It doesn't appear to be a longterm
problem, but I can't seem to figure out what is causing it for the
initial request.  As best I can tell Catalyst/CDBI just doesn't have
enough DB connections open to handle all the requests, but it doesn't
seem to be like it should be failing for any, just being slower than
subsequent requests.

Thanks,
Dylan



More information about the Catalyst mailing list