[Catalyst] Testcase for DBIx::Class::Loader - demonstrates failure under load

Brandon Black blblack at gmail.com
Mon Feb 13 15:31:48 CET 2006


On 2/13/06, Toby Corkindale <tjc at wintrmute.net> wrote:
> Hi,
> I think DBIx::Class::Loader is demonstrating a similar bug to the one I hit in
> Class::DBI::Loader some time ago, that was subsequently fixed by Daisuke Maki.
>
> I've attached a test case that demonstrates this in DBIx::Class:Loader,
> against PostgreSQL.
>
> The testcase is standalone, but replicates the way ::Loader is used by
> Catalyst, which is where I originally hit both these errors, when testing
> under load.
>
> Curiously, I tried to use the workaround that worked for Catalyst with
> Class::DBI::Loader, but it didn't seem to help here.
> (ie. forcing a disconnect with ->storage->disconnect immediately after the Cat
> setup() call.)
>
Loader 0.18 actually does its own ->storage->disconnect at the end of
setting itself up, to avoid people needing to do things like that. 
Are you sure your testcase isn't causing a new Loader object to be
initialized every time a new mod_perl child spawns?  That would
probably cause problems eventually if one kicked off before the other
was done.  (Whereas in the standard Cat usage with C::M::DBIC where
the whole Cat app is loaded up pre-forking, Loader should only ever
get initialized once).

I'll run the testcase and start figuring this out a bit later today

Thanks for the bugreport,
-- Brandon



More information about the Catalyst mailing list