From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Added inotify support. Date: Sat, 06 Oct 2012 13:01:03 -0400 Message-ID: References: <2181827.T3JxG88qQt@descartes> <83lifoa7hr.fsf@gnu.org> <87obkkcu92.fsf@wanadoo.es> <87lifkvoxl.fsf@spindle.srvr.nix> <87ehlbtv0r.fsf@spindle.srvr.nix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349542875 29994 80.91.229.3 (6 Oct 2012 17:01:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 17:01:15 +0000 (UTC) Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , emacs-devel@gnu.org To: Nix Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 19:01:21 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKXkZ-0005EP-8M for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 19:01:15 +0200 Original-Received: from localhost ([::1]:51869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXkT-0002NE-Gl for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 13:01:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXkR-0002N8-95 for emacs-devel@gnu.org; Sat, 06 Oct 2012 13:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKXkQ-0005vo-7Z for emacs-devel@gnu.org; Sat, 06 Oct 2012 13:01:07 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKXkQ-0005vk-3Q for emacs-devel@gnu.org; Sat, 06 Oct 2012 13:01:06 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q96H13Jq020809; Sat, 6 Oct 2012 13:01:03 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 2CAE7B40A1; Sat, 6 Oct 2012 13:01:03 -0400 (EDT) In-Reply-To: <87ehlbtv0r.fsf@spindle.srvr.nix> (nix@esperi.org.uk's message of "Sat, 06 Oct 2012 17:39:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154129 Archived-At: >> - 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. That's a misfeature that should be easy to fix (in the kernel): any FS should be able to indicate whether it will reliably send inotify notices, so that client code can be told when it requests inotify events for a particular object whether it will work reliably. >> 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, If nfsd applies a modification and it's not reflected with some inotify event, I think that's a bug that the kernel developers would want to fix. > 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 (!).) Slight semantic differences are probably unavoidable, so I think this would likely be considered as something you need to live with. >> 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. Can't that be fixed by making it possible to "compress" the queue, e.g. replace a bunch of events on FILE with a single "something happened to FILE", or in the worst case replace all the events with a single "queue filled up, all the files might have been modified in arbitrary ways". This would let it be reliable even in the face of lost events. >> 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 :( So there's nothing for Emacs to worry about, because Emacs won't fix those issues. Stefan