exodist / Child

(perl) Object oriented simple interface to fork()
9 stars 2 forks source link

Child->all_procs returns children that have already been reaped #11

Closed mephinet closed 9 years ago

mephinet commented 9 years ago

I just started using Child, so please bear with me if i'm wrong...

I'm planning to use Child on a long-running process (months) who's job it is to spawn dozens to hundreds of children per second, each of which will only be short-lived (maybe 10s). I intended to call $proc->wait every few seconds on all processed returned by Child->all_procs() which have is_complete set - so that all zombies are killed. However it turns out that these processes will show up again in the next round, because entries in @Child::PROCS is always pushed to, but never removed from.

For me, the expected behavior would be that once a child has been wait()ed for, it no longer shows up hen the all_procs list...

Do you agree, or did I misunderstand the intended use of Child?

exodist commented 9 years ago

I do believe you have found a bug, thank you for the report!