Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjbs (4671)

  (email not shown publicly)
AOL IM: RicardoJBSignes (Add Buddy, Send Message)
Yahoo! ID: RicardoSignes (Add User, Send Message)

I'm a Perl coder living in Bethlehem, PA and working Philadelphia. I'm a philosopher and theologan by training, but I was shocked to learn upon my graduation that these skills don't have many associated careers. Now I write code.

Journal of rjbs (4671)

Wednesday April 18, 2007
08:00 PM

sqlite: totally indestructable

[ #33026 ]

Today, I saw some SQLite failures occur when a process had consumed all its open filehandles with session databases. My first thought was that there was a circular reference preventing destruction. After an almost comical amount of struggle to get Devel::Cycle to work, and then an actually comical amount of struggle to get Devel::FindRef to not choke on DBI connections, the problem turned up. I'm pretty sure that I wrote the offending line. I feel fairly silly about it now, since it is a pretty clear one-line red flag. This is a close approximation:

$m->{_timer} = HTML::Mason::Timer->new(m => $m);


Unfortunately, while this was clearly a good bug to fix, it didn't solve the problem. The error log kept showing "closing dbh with active statement handles" even though everything relevant seemed to be calling $sth->finish. Finally, this helped:

sub DESTROY { my ($self) = @_; $_->finish for $self->{dbh}->ChildHandles; # This had to be added. $self->{dbh}->disconnect; }

Yow! I wonder whether there are a huge pile of people being affected by this. Maybe not, since using SQLite for sessions required a bit of a hack.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.