Skip Menu |

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

Report information
The Basics
Id: 44039
Status: resolved
Priority: 0/
Queue: POE-Component-Generic

People
Owner: Nobody in particular
Requestors: cpan [...] it.alldaypa.com
Cc:
AdminCc:

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



Subject: [PATCH 0.1100 Generic.pm] Fix leaking sockets on shutdown
Date: Wed, 11 Mar 2009 14:38:49 +0000
To: bug-POE-Component-Generic [...] rt.cpan.org
From: Paul Williams <cpan [...] it.alldaypa.com>
Hi, I noticed sockets weren't being closed down in my POE daemon which opens and closes many PoCo::Generic objects. I've attached a patch to address the POE::Wheel::Run sockets, which aren't closed when you shutdown an object. It's a very simple patch which deletes the wheel, cleaning up the open sockets in the shutdown() method - if ($self->{wheel}) { $self->{wheel}->shutdown_stdin; + delete $self->{wheel}; } I hope this is helpful and I can only apologise if I have patched incorrectly! Thanks, -Paul
--- a/Generic.pm 2009-03-11 13:30:53.000000000 +0000 +++ b/Generic.pm 2009-03-11 13:31:35.000000000 +0000 @@ -739,6 +739,7 @@ if ($self->{wheel}) { $self->{wheel}->shutdown_stdin; + delete $self->{wheel}; } undef; } @@ -1481,4 +1482,4 @@ =cut - \ No newline at end of file +
While this patch might work, its not what you want. The wheel shouldn't be deleted until the child has exited (sub _child). Imma poke at it a bit.
I moved the wheel delete to Generic->_child(), where it makes more sense. Added test cases to make sure the Generic session can exit cleanly. Version 0.1200 has been uploaded to the CPAN. Thank you for your report.