Re: [ANNOUNCE] mod_perl 2.0.5
Many thanks guys, for keeping mod_perl alive and well (and perl too for that matter). It is really a pity that not more people know how much their nice web applications depend on it. But then, maybe we should think that the people who matter, do know.
Re: [ANNOUNCE] mod_perl 2.0.5
On Mon, 2011-02-07 at 17:55 -0800, Fred Moyer wrote: > mod_perl 2.0.5 is here! Well done! and thanks clint
Re: DBI 1.61{1,6} + DBD::mysql 4.01{6,8} = segfault on Ubuntu 10.10 amd64? (reprise)
Hi, > I'm pointing at Class::XSAccessor since it's my only hint. > Seems to me that DBIx::Class uses Class::XSAccessor through > Class::Accessor::Grouped. That's the only use of Class::XSAccessor > I could find in my perl directories. The first thing I'd suggest is making sure you have the latest version. There's some stuff about recent fixes for segfaults in the changes file. > Next thing I'm going to try is to selectively remove bits from > my startup.pl to pinpoint areas of the code that might > lead to this segfault. Not a bad idea, but you also could remove Class::XSAccessor completely. The DBIx::Class docs say it's optional. - Perrin
Re: DBI and Apache::DBI issues
On Sun, Feb 6, 2011 at 4:44 PM, Max Pinton wrote: > Did earlier versions of Perl/mod_perl/DBI/Apache::DBI handle closures > differently? No, not at all. This is a core Perl thing. > I'm just curious why it used to work. It seems like DBI would > reconnect a $dbh closure if it timed out. One thing that might have changed is your database configuration. MySQL is often configured to automatically reconnect. That doesn't explain all of your errors though. I'm guessing that you're opening a connection during startup and forking with it. You need to find that. Look for things that might open a connection during startup and move them to ChildInitHandlers instead. - Perrin
Re: [ANNOUNCE] mod_perl 2.0.5
On Tue, Feb 8, 2011 at 4:10 AM, Clinton Gormley wrote: > On Mon, 2011-02-07 at 17:55 -0800, Fred Moyer wrote: >> mod_perl 2.0.5 is here! > > Well done! and thanks Thanks to the users who took the time to try out release candidates, fix and report bugs. Saw this today - word is getting out about the release: http://techfeed.ru/2011/02/vyshel-modperl-2-0-5/
Re: DBI and Apache::DBI issues
On Feb 8, 2011, at 7:36 AM, Perrin Harkins wrote: I'm just curious why it used to work. It seems like DBI would reconnect a $dbh closure if it timed out. One thing that might have changed is your database configuration. MySQL is often configured to automatically reconnect. I checked $dbh->{mysql_auto_reconnect} and, as per the docs, it's 1 in a mod_perl script and 0 otherwise. Is there another place to look? It seems like something I'd really want to have on. That doesn't explain all of your errors though. I'm guessing that you're opening a connection during startup and forking with it. You need to find that. Look for things that might open a connection during startup and move them to ChildInitHandlers instead. That's puzzling. I'm not forking anywhere in my scripts. I did once try using threads for something, but abandoned it because it segfaulted in mod_perl and it wasn't db-related anyway. My startup.perl (minus my modules) is: #!/usr/bin/perl use strict; # make sure we are in a sane environment. $ENV{MOD_PERL} or die "not running under mod_perl!"; use ModPerl::Registry (); # Apache::DBI must be before DBI #use Apache::DBI (); use DBI (); use CGI '-no_xhtml'; CGI->compile(':all'); use GD (); use MIME::Base64 (); use Data::Dumper (); use XML::Simple (); use XML::Writer (); use File::Temp; 1; Does anything there look fishy? Thanks, Max
Re: DBI and Apache::DBI issues
On Tue, Feb 8, 2011 at 16:26, Max Pinton wrote: > On Feb 8, 2011, at 7:36 AM, Perrin Harkins wrote: >> That doesn't explain all of your errors though. I'm guessing that >> you're opening a connection during startup and forking with it. You >> need to find that. Look for things that might open a connection >> during startup and move them to ChildInitHandlers instead. > > That's puzzling. I'm not forking anywhere in my scripts. I did once try > using threads for something, but abandoned it because it segfaulted in > mod_perl and it wasn't db-related anyway. My startup.perl (minus my modules) > is: You could always try strace to find if there are any fork/clone calls: strace -e trace=fork,clone httpd -X > [startup.perl] > Does anything there look fishy? Nothing jumps out at me.
Re: DBI and Apache::DBI issues
On Tue, Feb 8, 2011 at 6:26 PM, Max Pinton wrote: > I checked $dbh->{mysql_auto_reconnect} and, as per the docs, it's 1 in a > mod_perl script and 0 otherwise. Is there another place to look? It seems > like something I'd really want to have on. Recommended practice is to turn this off. If it's on and you lose your connection for some reason in the middle of handling a web request, the client will try to reconnect and keep going with the rest of the request. That's almost certainly not what you want in any situation where data is modified. Apache::DBI or DBI->connect_cached() are better because they only reconnect when you tell them to, at the beginning of the requests. However, this means that if you use Apache::DBI you MUST call DBI->connect() at the beginning of every request and not cache the $dbh objects yourself. >> That doesn't explain all of your errors though. I'm guessing that >> you're opening a connection during startup and forking with it. You >> need to find that. Look for things that might open a connection >> during startup and move them to ChildInitHandlers instead. > > That's puzzling. I'm not forking anywhere in my scripts. I meant apache forking child processes after startup. > My startup.perl (minus my modules) The problem in this case would be in your modules. One of them probably opens a database connection for some reason. You can see it happen by using DBI_TRACE. - Perrin
Re: DBI 1.61{1,6} + DBD::mysql 4.01{6,8} = segfault on Ubuntu 10.10 amd64? (reprise)
On Tue, Feb 08, 2011 at 10:32:02AM -0500, Perrin Harkins wrote: > > I'm pointing at Class::XSAccessor since it's my only hint. > > Seems to me that DBIx::Class uses Class::XSAccessor through > > Class::Accessor::Grouped. That's the only use of Class::XSAccessor > > I could find in my perl directories. > > The first thing I'd suggest is making sure you have the latest > version. There's some stuff about recent fixes for segfaults in the > changes file. Confirmed. Class::XSAccessor 0.11 (latest CPAN version atm) fixes my segfault problems. Thanks Perrin, -- Cosimo