Skip Menu |

This queue is for tickets about the POE-Component-Generic CPAN distribution.

Report information
The Basics
Id: 46346
Status: open
Priority: 0/
Queue: POE-Component-Generic

People
Owner: Nobody in particular
Requestors: jettero [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.1201
Fixed in: (no value)



I couldn't say for sure if this is a bug or not. I'm using the Shout.pm API for shoutcast/icecast and during some socket errors (about 3 of 4 server restarts actually), my poco::g call never posts an event *and* poco::g exits without calling my error event ... exit without a trace. I tracked this down to the fact that the process exits without error, but with a positive exit value. Show quoted text
> MY::Shout: Wheel 1 generated read error 0: > MY::Shout: Wheel 1 generated read error 0: > MY::Shout: Wheel closed > MY::Shout: Child 4312 exited with 13 at
/usr/local/share/perl/5.8.8/POE/Component/Generic.pm line 699. Show quoted text
> MY::Shout: _done at
/usr/local/share/perl/5.8.8/POE/Component/Generic.pm line 308. Show quoted text
> MY::Shout: remove alias MY::Shout at
/usr/local/share/perl/5.8.8/POE/Component/Generic.pm line 322. Show quoted text
> MY::Shout: _stop at
/usr/local/share/perl/5.8.8/POE/Component/Generic.pm line 298. Show quoted text
> MY::Shout: DESTROY at
/usr/local/share/perl/5.8.8/POE/Component/Generic.pm line 825 during global destruction. Since the errno is 0, it intentionally never calls my error event: Show quoted text
> sub __wheel_err { > my ($self, $operation, $errnum, $errstr, $wheel_id) = @_[OBJECT,
ARG0..ARG3]; Show quoted text
> > warn "$self->{name}: Wheel $wheel_id generated $operation error
$errnum: $errstr\n" Show quoted text
> if $self->{debug} or > ( $self->{verbose} and $errnum != 0 ); > if( $errnum!=0 and $self->{error} ) { > $poe_kernel->post( $self->{error_session}, $self->{error}, > { operation => $operation, > errnum => $errnum, > errstr => $errstr } > ); > } > }
I propose that this could be fixed for me (and possibly for others) by allowing a child-exit event like this (or something like it). (Clearly this would require more support elsewhere in the module.) sub _child { my( $self, $name, $PID, $ret ) = @_[ OBJECT, ARG0..ARG2 ]; unless( $PID == ($self->{child_PID}||0) ) { $self->{debug} and warn "$self->{name}: Got CHLD for $PID"; return; } # NEW if( $self->{child_exit) ) { $self->{debug} and warn "$self->{name}: Child $PID exited with $ret -- telling parent with child_exit event"; $poe_kernel->post( $self->{exit_session}, $self->{child_exit}, { exit_value => $ret } ); } # /NEW $self->{debug} and warn "$self->{name}: Child $PID exited with $ret"; $poe_kernel->sig_handled; $self->_done; return; } -- If riding in an airplane is flying, then riding in a boat is swimming. 107 jumps, 43.5 minutes of freefall, 83.4 freefall miles.
On Mon May 25 08:33:42 2009, JETTERO wrote: Show quoted text
> > I couldn't say for sure if this is a bug or not.
Feature request. Show quoted text
> I propose that this could be fixed for me (and possibly for others) by > allowing a child-exit event like this (or something like it). > (Clearly this would require more support elsewhere in the module.)
Yeah. I need to add a mechanism that would allow you to know when the child process has exited. I'm pondering several options. For now, your patch will probably work for you.
Subject: Re: [rt.cpan.org #46346]
Date: Tue, 15 Sep 2009 10:55:28 -0400
To: bug-POE-Component-Generic [...] rt.cpan.org
From: Paul Miller <jettero [...] cpan.org>
On Tue, Sep 15, 2009 at 10:43 AM, Philip Gwyn via RT <bug-POE-Component-Generic@rt.cpan.org> wrote: Show quoted text
> Yeah.  I need to add a mechanism that would allow you to know when the > child process has exited.  I'm pondering several options.  For now, your > patch will probably work for you.
I had forgotten about this. Thanks for your attention on it. The problem is essentially solved on my end. I'm excited to see what you choose to "fix" it. -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Version 0.1400, which I just uploaded, has an 'on_exit' option which will do what you want.