Possible minor bug in AnyEvent :: Impl :: POE -> io
Andreas Breslau
abreslau at smail.uni-koeln.de
Thu Mar 17 18:36:03 CET 2016
Hi all,
I use AnyEvent for a while now and want to say thanks for it ;-)
Now I found something in AnyEvent in combination with POE what I
consider a bug, which I want to report here, to help improving it:
In AnyEvent :: Impl :: POE the filehandle ($fh) created in sub io() with
AnyEvent::_dupfh and passed to POE::Session->create() is not
closed/deleted in stop => sub {}.
This is also the case for the current version of AnyEvent :: Impl :: POE
from CPAN (7.12).
In my application with AnyEvent and Curses :: UI :: POE this results and
on my systems (Debian/Ubuntu) in a growing number of open
filedescriptors in /proc/pid/fd and a crash of the whole script when the
maximum number of filedescriptors is reached after some time.
Without POE, e.g. with AnyAnyEvent->condvar->recv or the Gtk2 eventloop
this does not happen.
I fixed this problem for me be by changing the stop callback to:
stop => sub {
$_[KERNEL]->$pee ($fh);
close $fh;
undef $fh;
}
I found no other place where this duped filehandle is closed, so this
might be a bug which should be fixed.
Or does this only occur on my system and I missed something?
Greetings from Goettingen
Andreas
More information about the anyevent
mailing list