Re: mod_perl2 + fork + DBI = Chaos

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Mon, Jan 25, 2010 at 3:48 PM, Tosh Cooey <[email protected]> wrote:
> 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?

After you call exit?  No.  It should be gone.  That's a zombie process.

> That PM thread seems to indicate that I must disconnect every DBH, not just
> the ones that I will use.

Either that, or you need to set InactiveDestroy on all of them in the
child process.  Otherwise, when the child exits, it messes up all of
them for the parent.

> Are you also suggesting the use of
> Parallel::ForkManager for forks?

No.  The DBI stuff is the same with either.

- Perrin
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.