Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the AnyEvent-Filesys-Notify CPAN distribution.

Report information
The Basics
Id:
115562
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
dave [...] jetcafe.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: File descriptor leak in 1.20?
Date: Thu, 23 Jun 2016 11:27:07 -0700
To: bug-AnyEvent-Filesys-Notify@rt.cpan.org
From: Dave Hayes <dave@jetcafe.org>
Apparently, the following code demonstrates a file descriptor leak in 1.20. Is there something I'm not understanding here? :) #!/usr/local/bin/perl BEGIN { use lib qw(lib); } use EV; use AnyEvent; use AnyEvent::Filesys::Notify; use AnyEvent::Filesys::Notify::Role::KQueue; $AnyEvent::Filesys::Notify::Role::KQueue::WARN_FILEHANDLE_LIMIT = 1; mkdir("/tmp/foobar"); my $q_watcher = AnyEvent::Filesys::Notify->new( backend => 'KQueue', dirs => [ "/tmp/foobar"], cb => sub { foreach my $e (@_) { my $path = $e->path; my $type = $e->type; return unless ($type eq 'created' && -f $path); warn "Removing '$path'\n"; unlink($path); } }, ); my $stresser = AnyEvent->timer( after => 1, interval => 0.25, cb => sub { my $path = "/tmp/foobar/stress"; if (open(S,">$path")) { print S "\n"; close(S); warn "Touching '$path'\n"; } else { warn "Can't open $path: $!\n"; } }, ); EV::run; die "Shouldn't ever get here\n"; -- Dave Hayes - Consultant - Altadena CA, USA - dave@jetcafe.org
Show quoted text
>>>> *The opinions expressed above are entirely my own* <<<<
Our greatest fears are shadows of things that don't exist.
You are correct. I'm releasing a new version which will attempt to deal with the issue by monitoring the delete events.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.