Subject: | Critical bug (or worst misunderstanding) |
Date: | Fri, 1 May 2015 15:37:26 +0200 |
To: | bug-Linux-Inotify2 [...] rt.cpan.org |
From: | Lavock <lavock [...] gmail.com> |
Hello,
I currently use this module in my day work, in sort of monitor of heavily
distributed application. I observed some kind of race condition doing so.
Further invistigation lead me to this experimention :
#!/usr/bin/perl
Show quoted text
>
> use v5.18;
>
> use strict;
>
> use warnings;
>
>
And this prododuce the following result :
1 event(s) where received
Show quoted text>> use EV;
>
> use AnyEvent;
>
> use Linux::Inotify2;
>
>
>>
>> my $inotify = Linux::Inotify2->new();
>
>
>> $inotify->watch("./test_file", IN_CLOSE_WRITE);
>
>
>> my $cv = AE::cv;
>
>
>> my $inotify_watcher = AE::io $inotify->fileno, 0, sub {
>
> open my $fh, '>>', './test_file';
>
> say $fh "plop";
>
> close $fh;
>
>
>> #say scalar($inotify->read) . " event(s) where received";
>
> say $inotify->poll . " event(s) where received";
>
> $cv->send;
>
> };
>
>
>> open my $fh, '>', './test_file';
>
> say $fh "plop";
>
> close $fh;
>
>
>> open $fh, '>>', './test_file';
>
> say $fh "plop";
>
> close $fh;
>
>
>> $cv->recv;
>
>
>
Actually, should'nt be "3" ?
Regards,
Lavock.