emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Added inotify support.


From: Nix
Subject: Re: [PATCH] Added inotify support.
Date: Sat, 06 Oct 2012 17:39:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

On 5 Oct 2012, Stefan Monnier verbalised:

>> Of course you can't rely on inotify rather than polling, because inotify
>> simply silently omits all changes that come from other hosts when an fs
>> is mounted or exported over the network.
>
> Of course, it also doesn't help when Emacs is built without inotify.
> The main questions would then be:
> - how often does it work?  I think this is likely to be "often" since it
>   should work for most/all the "home desktop" as well as laptop use
>   cases.

Most, but certainly not all: I have a home desktop, but it so happens
that I have my home directory on a separate low-power home server so
that I can shut the desktop down when not in use. If I run Emacs on the
desktop machine, it's not going to see inotify watches on my home
directory -- or, rather, it'll see those performed by the desktop, but
not those performed by the server (e.g. email delivery).

> - can we reliably determine whether it will work?

No :( you get that subset of events that happened on the local machine
only, but even I ran Emacs on the server, it would see a local
filesystem but would *still* miss events -- those happening on the
desktop.

>   IIUC inotify works reliably for local file-systems (even if they're
>   exported because the other hosts's actions will be locally performed
>   by the nfsd)

Those don't always appear :( the nfsd doesn't do all its actions at a
level that inotify can see, alas, and certainly won't necessarily
generate the expected events for them (a touch shows up as an attrib
event locally, but an open if it's something the nfsd has done on behalf
of a remote client (!).)

>                but not for file-systems mounted from a remote host.
>   Can inotify inform Emacs that its notices won't be reliable (so Emacs
>   can decide to use polling instead)?

I don't think so. The answer in any case is 'inotify is never reliable':
even if the FS is not exported across the network and never becomes
exportted across the network, the queue can fill up and lose events and
the like.

I really really wish notify worked over the network :(

>> inotify and friends are only spying on local VFS traffic, which in my
>> experience makes them less than useful for most applications.
>
> Aren't they used by most GUI file managers?

Yes. If you have an NFS-mounted home directory, you get used to hitting
refresh in GUI file managers :(

inotify basically sucks for these reasons and others, but the kernel
people say that they don't care if it doesn't work over the network and
that it can't be made to work anyway, and the desktop people who make
use of inotify say that nobody uses NFS and everyone just has a single
laptop and your use case is out of scope, go away. Meanwhile, Windows
does file notification over the net perfectly well and has for years.

:(

-- 
NULL && (void)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]