Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: open2 unreliable?

by Helter (Chaplain)
on Nov 12, 2002 at 18:26 UTC ( [id://212346]=note: print w/replies, xml ) Need Help??


in reply to open2 unreliable?

I had to help someone fix an issue with IPC:Open2 a week or so ago, we were seeing all the processes turn to zombies in a Linux environment.

Our problem was 2 fold, we were not flushing the buffers enough:
$| = 1;
This fixed that problem (buffer by line instead of chunk).

The second problem was a little stranger (zombies invading our machines...late night sci-fi here we come!)

I had to read 3 docs on IPC:Open2 before I found this on the CPAN site (IPC:Open2):
open2() does not wait for and reap the child process after it exits. E +xcept for short programs where it's acceptable to let the operating s +ystem take care of this, you need to do this yourself. This is normal +ly as simple as calling waitpid $pid, 0 when you're done with the pro +cess. Failing to do this can result in an accumulation of defunct or +"zombie" processes. See perlfunc/waitpid for more information.
You won't find this text (unfortunitly) in  perldoc perlipc. Or in the Camel, at least I can't find it :)

Hope this helps, and I'm not making some glaring error :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found