Re: mod_perl2 + fork + DBI = Chaos

Tosh Cooey <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Organization Twelve Hundred Group LLC
Message-ID <[email protected]>
Perrin Harkins wrote:
> On Mon, Jan 25, 2010 at 2:41 PM, Tosh Cooey <[email protected]> wrote:
>> Just to follow up on this before anyone spends any time caring about it, the
>> seg faults could also be because one of the zombie apache2 processes I've
>> spawned like a Gremlin is answering the request and well...
> 
> I don't think so.  That's not how apache works.
> 
>> So, if I've done the fork properly and pretend I have apache PIDs 1..10
>> running, and the child is 11 and it does it's thing and hits CORE::exit(0)
>> should that process then die?
> 
> Yes.
> 
> Here's some advice about using DBI with forking:
> http://www.perlmonks.org/?node_id=752289


Thanks Perrin, the forking, my child got a PID of 30033 and then 
afterwards when I checked the processes (ps) for 30033 I see:

[apache2] <defunct>

Is that what's supposed to happen?

That PM thread seems to indicate that I must disconnect every DBH, not 
just the ones that I will use.  That's correct?  It seems 
counterintuitive to disconnect all DBHs.  Are you also suggesting the 
use of Parallel::ForkManager for forks?

I hope at least I have the forking properly working so I can concentrate 
on the DBI issue...

Tosh


-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.