Skip Menu |

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

Report information
The Basics
Id: 32449
Status: resolved
Worked: 5 min
Priority: 0/
Queue: POE-Component-EasyDBI

People
Owner: GVL [...] cpan.org
Requestors: AGRUNDMA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.23
Fixed in: (no value)



Subject: [Patch] Don't remove alias until child has been shut down
alias_remove is being called too soon. If I want to find out if an EasyDBI session has really been shut down, the alias_remove call needs to be moved to after the child has been reaped. Patch is attached.
Subject: alias-remove.patch
Index: lib/POE/Component/EasyDBI.pm =================================================================== --- lib/POE/Component/EasyDBI.pm (revision 37) +++ lib/POE/Component/EasyDBI.pm (working copy) @@ -318,11 +318,6 @@ DEBUG && warn 'Duplicate shutdown NOW fired!'; return; } - } else { - # Remove our alias so we can be properly terminated - $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne ''); - # and the child - $kernel->sig( 'CHLD' ); } # Check if we got "NOW" @@ -946,8 +948,17 @@ } sub sig_child { - delete $_[HEAP]->{wheel_pid}; - $_[KERNEL]->sig_handled(); + my ($kernel, $heap) = @_[KERNEL, HEAP]; + + delete $heap->{wheel_pid}; + $kernel->sig_handled(); + + if ( $heap->{shutdown} ) { + # Remove our alias so we can be properly terminated + $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne ''); + # and the child + $kernel->sig( 'CHLD' ); + } } # ----------------
Fixed in 1.24. Thank you.