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.