Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: mod_perl and lazy zombies

by gildir (Pilgrim)
on Jun 07, 2001 at 19:11 UTC ( [id://86585]=note: print w/replies, xml ) Need Help??


in reply to mod_perl and lazy zombies

With open(FH,"....|") perl in fact does not open a file, but a pipe to a newly created process. When this process exits, it stays as a zombie as long as parent process does not collects its exit staus. In C this is done by calling wait() or waitpid() function. Perl gives you an abstraction for accessing processed as files, but the final collection of child's exit status must be done anyway and it is done in the close function.

There is no direct or easy way of mod_perl doing this for you (except for some playing with SIGCHLD handler, but there you will be a subject to filehandle leakage as well). So just call close when it is appropriate.

To allway call close on everything that was open is a good practice in any environment not only in mod_perl. But as mod_perl processes are long-running, this bad practice pops up as a problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://86585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found