Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re: mod_perl and lazy zombies by gildir
in thread mod_perl and lazy zombies by Odud

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-25 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found