It sounds as if the program is exiting before all the child processes can be reaped. To avoid process leaks, POE will reap all outstanding attached child processes before exiting. The annoying warning is to let you know there's a problem. POE is often used in long-running daemons, where a silent process leak can lead to a mysteriously dead machine.

So, what can you do? Try sig_child() rather than sig() to reap specific process IDs. For example:

sub start_wheel { my $child = POE::Wheel::Run->new( ... ); $_[HEAP]{child} = $child; $_[KERNEL]->sig_child( $child->PID => "sig_child" ); }

The sig_child() method asks that an event be dispatched when a specific PID is reaped. In this case, the PID associated with a particular POE::Wheel::Run instance. sig_child() is more convenient than the blanket sig() handler. Also, a session waiting for a specific PID will be kept alive until that process is reaped. If my guess is correct, this last feature should avert your program's warnings.

sig_child() is documented in POE::Kernel, with the other POE::Kernel methods.


In reply to Re: destroying/reaping a POE::Wheel by rcaputo
in thread destroying/reaping a POE::Wheel by megamic

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.