Re: perl -c fails with FilterSnoop example in docs

2011-02-23 Thread Perrin Harkins
On Tue, Feb 22, 2011 at 3:32 PM, Mark Hedges  wrote:
> I copied this useful debugging filter at
> http://perl.apache.org/docs/2.0/user/handlers/filters.html#All_in_One_Filter
>
> It works fine, but I can't `perl -c` :

Yes, the modules that are built to run in the context of Apache HTTPD
mostly will not run from the command-line.  They are missing the
environment they expect.  To test them, you need to run them through
mod_perl.  See Apache::Test.

- Perrin


Apache::DBI and DBD::mysql ping not working

2011-02-23 Thread Daniel Manley

Hi,

I've been digging around in my mod_perl-based apps and trying to figure 
out why setting up the DB connections for pinging is still randomly 
producing first-thing-in-the-morning "mysql server has gone away" 
errors.  I read up about the morning bug and such (adding ping() to 
mysql.pm based on examples on the net) and still can't get it working.  
I'm using apache 2.2.17 and mod_perl 2.0.4.


so - I finally started digging into the Apache::DBI, DBD::mysql and 
DBD::Oracle packages -- I put in warn messages all over the place and 
turned on various debugs.  I see my debug messages from Oracle's ping 
call in the apache error log.  But I can never get the mysql ping to 
show its warn messages.  not via Apache::DBI's calls to it or my own 
forced ping call on the dbh.  So I can only conclude that it's not 
getting to the ping() method in DBD/mysql.pm


any idea where the mysql ping happens or why it's not?  is the top-level 
DBI package interfering?


(inserted right after the prepare method in the DBD::mysql::db package 
section)


sub ping {
 my ($dbh) = @_;
 my $ret = 0;
warn "DANDAN:  mysql ping!!";
 eval {
   local $SIG{__DIE__}  = sub { return (0); };
   local $SIG{__WARN__} = sub { return (0); };
   # adapt the select statement to your database:
   $ret = $dbh->do('select 1');
warn "DANDAN: selected 1";
 };
 return ($@) ? 0 : $ret;
}

similar warn messages in DBD::Oracle's ping show up just fine in Apache 
error log.


Dan



Re: Apache::DBI and DBD::mysql ping not working

2011-02-23 Thread Daniel Manley
well, I think I figured this one out on my own.  Though I've used Perl 
for a number of years, I've never gotten to the XS file coding.  and so 
after running this under perl debug, I finally get the hint that maybe 
the mysql ping() is done in C.  And so it is.


Dan


On 11-02-23 11:28 AM, Daniel Manley wrote:

Hi,

I've been digging around in my mod_perl-based apps and trying to 
figure out why setting up the DB connections for pinging is still 
randomly producing first-thing-in-the-morning "mysql server has gone 
away" errors.  I read up about the morning bug and such (adding ping() 
to mysql.pm based on examples on the net) and still can't get it 
working.  I'm using apache 2.2.17 and mod_perl 2.0.4.


so - I finally started digging into the Apache::DBI, DBD::mysql and 
DBD::Oracle packages -- I put in warn messages all over the place and 
turned on various debugs.  I see my debug messages from Oracle's ping 
call in the apache error log.  But I can never get the mysql ping to 
show its warn messages.  not via Apache::DBI's calls to it or my own 
forced ping call on the dbh.  So I can only conclude that it's not 
getting to the ping() method in DBD/mysql.pm


any idea where the mysql ping happens or why it's not?  is the 
top-level DBI package interfering?


(inserted right after the prepare method in the DBD::mysql::db package 
section)


sub ping {
 my ($dbh) = @_;
 my $ret = 0;
warn "DANDAN:  mysql ping!!";
 eval {
   local $SIG{__DIE__}  = sub { return (0); };
   local $SIG{__WARN__} = sub { return (0); };
   # adapt the select statement to your database:
   $ret = $dbh->do('select 1');
warn "DANDAN: selected 1";
 };
 return ($@) ? 0 : $ret;
}

similar warn messages in DBD::Oracle's ping show up just fine in 
Apache error log.


Dan





Re: On memory consumption - request for comments

2011-02-23 Thread Max Kanat-Alexander
Hey Fred. So given the discussion that we've had on this, do you think
that the next version of SizeLimit could change its Linux behavior to
return the more appropriate rss size?

-Max
-- 
http://www.bugzillasource.com/
Competent, Friendly Bugzilla, Perl, and IT Services


Re: On memory consumption - request for comments

2011-02-23 Thread Torsten Förtsch
On Thursday, February 24, 2011 07:45:29 Max Kanat-Alexander wrote:
>   Hey Fred. So given the discussion that we've had on this, do you think
> that the next version of SizeLimit could change its Linux behavior to
> return the more appropriate rss size?

yes

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net