Rafael Garcia-Suarez wrote:
Stas Bekman wrote:

Well, the pid change is already out there in perl 5.8.1, so we need to
make it more friendly for applications that embed perl on Linux. I think
the fix should go both in blead and maint.

Seeing the rush of restoring some things as they were in 5.8.0 for 5.8.2, I just thought that this could be one of the things that needs to be reverted as well. Of course if the patch that we discussed does the trick, than it's fine.


Haven't we another similar (but more general) problem with $$ ?

While the PPID is cached in PL_ppid on Linux and for perl >= 5.8.1 with
ithreads, the PID is cached, for all perl versions I know of, and on all
platforms, in $$ (which is a regular SV).

That means that if an application that embeds perl forks, $$ is
not going to be updated.

As far as I can tell this doesn't impact mod_perl 1, because of
mod_perl_init_ids() in perl_util.c (called at child init time).

I don't think this happens on mod_perl 2 with prefork MPM, but I'm not
sure why. Could someone try with mod_perl 2 / threaded or prefork MPM to
see if the problem on $$ exists ? (Sorry, lacking time to test this
myself now) I see that mod_perl 2 has a function modperl_perl_init_ids()
in modperl_perl.c. That would probably a good place to reinit PL_ppid
as well.

With your patch both threaded/prefork seem to do alright. The interesting thing is that with worker (threaded) mpm the test prints:


# ppid 18673
ok 1
# pid 18675
ok 2

And the ps tree shows:

% pstree -p | grep httpd
        |-httpd(18673)-+-httpd(18674)
        |              `-httpd(18675)---httpd(18676)-+-httpd(18678)
        |                                            |-httpd(18679)
        |                                            `-httpd(18680)

the last column are real httpd threads, the first is the real parent and the second column are supposedly the procs containing the httpd threads. I'm not sure what's the third column. It's like there is yet another process in the middle. So I'm not sure whether the whole picture is correct.

Of course under preforked mpm it's simple:

        |-httpd(23678)-+-httpd(23679)
        |              `-httpd(23682)

# ppid 23678
ok 1
# pid 23679
ok 2

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to