Subject: Re: bug#21432: 25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted

From: Tassilo Horn <[email-masked]>
Date: Tue, 15 Sep 2015 07:53:34 +0200

Eli Zaretskii <[email-masked]> writes:

>> Done, however the descriptors still don't become invalid when
>> deleting the parent directory of the watched file or directory.  I
>> guess, that's a problem in the inotify and TRAMP implementations
>> then.
>
> No, I think it's a problem with our mental model of what happens.  The
> file notifications use the Emacs event loop, and Emacs won't check for
> events until it's idle.  So calling file-notify-valid-p as part of the
> test ends up doing that _before_ the directory deletion notification
> is read by Emacs and invalidates the watch.

Yes, you are right.  Michael already fixed the tests by waiting for the
file notifications before calling `file-notify-valid-p' and then we get
the expected results (well, not yet with remote files).

Bye,
Tassilo