Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 127161
Status: new
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: drrho [...] cpan.org
Cc:
AdminCc:

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



Subject: IO::Async::File sensitive to file going away
When a file watcher is active, and the file is moved/deleted, at some stage the call to stat() will make the program crash. As a trivial counter measure I wrapped the call into an eval {}. Interestingly enough, IO::Async::File recovers nicely when the file is recreated. Trivial patch attached. \rho PS: I am doing A LOT with IO::Async now and it has not yet failed me. Thx!!
Subject: async-file-eval.patch
--- /home/rho/tmp/lib/IO/Async/File.pm 2018-09-19 18:19:55.527191890 +0200 +++ /home/rho/packages/IO-Async-0.70.22794/lib/IO/Async/File.pm 2015-12-15 19:19:16.000000000 +0100 @@ -171,11 +171,7 @@ my $self = shift; my $old = $self->{last_stat}; - my $new; - eval { - $new = stat( defined $self->{filename} ? $self->{filename} : $self->{handle} ); - }; - return unless defined $new; + my $new = stat( defined $self->{filename} ? $self->{filename} : $self->{handle} ); my $any_changed; foreach my $stat ( @STATS ) {