List Info

Thread: Releasing an independent Apache::SizeLimit to CPAN?




Releasing an independent Apache::SizeLimit to CPAN?
user name
2006-06-16 17:08:19
On Friday 16 June 2006 17:23, Perrin Harkins wrote:
> Dave Rolsky wrote:
> > Apache::SizeLimit has a long-standing bug on Linux
where it never
> > actually kills a child, because of Perl's caching
of ppid info
> > internally, and the way this interacts with
Apache's forking.
> >
> > See this thread for details:
> > http://mail-archives.apache.org/mod_mbo
x/perl-modperl/200505.mbox/%3C51EE
> >FE1ECF72D811B384000E7F228BB7024CC6BCDEBAGE71.BERTELSMANN.DE%3E
>
> You're saying that it always thinks it is in the main
process even
> though it's actually in a child?  I haven't seen this
behavior.  Is it
> specific to certain versions of Perl or Linux?

Yes, since 5.8.1. The problem is that the now old
linux-threads implementation 
returns different values for getpid() and getppid() for
different threads. 
Hence Perl decides better to cache these values and update
the cache on 
fork() to make it more compatible with other thread
implementations. Since 
Apache does its own fork the cache is not updated. Mp2
contains code that 
handles the situation but mp1 does not.

For more information see also

http://www.gossamer-threads.com/lists/perl/porters/1931
62
http://www.gossamer-threads.com/lists/perl/porters/1758
06

Dave, have you tried the proposed approach from the thread
you mentioned?

> PerlModule Perl::AfterFork
> PerlModule Apache::Constants
> PerlInitHandler "sub {Perl::AfterFork::reinit();
return Apache::OK;}"
> 
> or
> 
> PerlModule Perl::AfterFork
> PerlInitHandler "sub
{Perl::AfterFork::reinit();}"

If you are working on Apache::SizeLimit maybe you could
incorporate also 
Linux::Smaps for newer kernels. Also the problem of counting
out of core 
pages could be addressed at least in the docs, see

http://www.gossamer-threads.com/lists/modperl/dev/84375

Torsten
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )