Skip Menu |

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: 105281
Status: resolved
Priority: 0/
Queue: AnyEvent-Filesys-Notify

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

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



Subject: Broken symlinks produce exception in KQueue backend
Date: Tue, 16 Jun 2015 17:47:03 -0700
To: bug-AnyEvent-Filesys-Notify [...] rt.cpan.org
From: Dave Hayes <dave [...] jetcafe.org>
In the KQueue backend, there's this code: sub _watch { my ( $self, $path ) = @_; open my $fh, '<', $path or do { warn "KQueue requires a filehandle for each watched file and directory.\n" . "You have exceeded the number of filehandles permitted by the OS.\n" if $! =~ /^Too many open files/; croak "Can't open file ($path): $!"; }; ... Note that if $path points to a broken symlink this will die. I'm not sure what the use case is where you'd want that. Is it possible to make an option to have ENOENT fail more gracefully (maybe print a warning instead)? Thanks in advance. -- Dave Hayes - Consultant - Altadena CA, USA - dave@jetcafe.org Show quoted text
>>>> *The opinions expressed above are entirely my own* <<<<
By and large, language is a tool for concealing the truth. -George Carlin
Can you provide more details on when this happens? We already take steps to avoid watching a broken symlink (in the _scan_fs method). What arguments are you passing to new()? What is in the watched directory? Which O/S and filesystem are you using? I'm willing to ignore or turn this into a warning, but I've yet to be able to reproduce it. Thanks
Subject: Re: [rt.cpan.org #105281] Broken symlinks produce exception in KQueue backend
Date: Wed, 17 Jun 2015 18:42:35 -0700
To: bug-AnyEvent-Filesys-Notify [...] rt.cpan.org
From: Dave Hayes <dave [...] jetcafe.org>
On 06/17/2015 17:51, Mark Grimes via RT wrote: Show quoted text
> Can you provide more details on when this happens? We already take steps to avoid watching a broken symlink (in the _scan_fs method).
Oops. I finally determined that this bug is in my subclass and not in your code. (I do an lstat() and not a stat() because I do not want to follow symlinks.) Please close this bug, and very sorry to bother you. -- Dave Hayes - Consultant - Altadena CA, USA - dave@jetcafe.org Show quoted text
>>>> *The opinions expressed above are entirely my own* <<<<
Truth (n.) - the most deadly weapon ever discovered by humanity. Capable of destroying entire perceptual sets, cultures, and realities. Outlawed by all governments everywhere. Possession is normally punishable by death.
No problem. If you have overridden _stat(), it should be relatively simple to check for a broken link and return undef. I'll mark this closed.