From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21432: 25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted Date: Sat, 12 Sep 2015 18:11:37 +0300 Message-ID: <83fv2jbrkm.fsf@gnu.org> References: <87k2s15sfd.fsf@gnu.org> <83oahc7vxr.fsf@gnu.org> <87lhcgvr1t.fsf@gmx.de> <87r3m4hrfq.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1442070745 5784 80.91.229.3 (12 Sep 2015 15:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2015 15:12:25 +0000 (UTC) Cc: 21432@debbugs.gnu.org, tsdh@gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 12 17:12:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZamTM-00076Z-1e for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2015 17:12:12 +0200 Original-Received: from localhost ([::1]:32804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZamTK-0001XJ-7e for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2015 11:12:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZamTG-0001Sf-0R for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 11:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZamTC-0005YQ-Ky for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 11:12:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZamTC-0005YC-I2 for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 11:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZamTB-0005RG-UE for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 11:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Sep 2015 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21432 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21432-submit@debbugs.gnu.org id=B21432.144207070620882 (code B ref 21432); Sat, 12 Sep 2015 15:12:01 +0000 Original-Received: (at 21432) by debbugs.gnu.org; 12 Sep 2015 15:11:46 +0000 Original-Received: from localhost ([127.0.0.1]:58484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZamSw-0005Qj-5H for submit@debbugs.gnu.org; Sat, 12 Sep 2015 11:11:46 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:43159) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZamSt-0005QZ-Nd for 21432@debbugs.gnu.org; Sat, 12 Sep 2015 11:11:44 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NUK00C00KV3MN00@mtaout28.012.net.il> for 21432@debbugs.gnu.org; Sat, 12 Sep 2015 18:11:27 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NUK008JCKV3J230@mtaout28.012.net.il>; Sat, 12 Sep 2015 18:11:27 +0300 (IDT) In-reply-to: <87r3m4hrfq.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106452 Archived-At: > From: Michael Albinus > Cc: Tassilo Horn , 21432@debbugs.gnu.org > Date: Sat, 12 Sep 2015 12:18:01 +0200 > > Michael Albinus writes: > > > Eli Zaretskii writes: > > > >>> I don't have a strong opinion about what the right behavior would be but > >>> at least it seems inconsistent that you get the error only with deleted > >>> directories. > >> > >> There is no "right" behavior. What you see is what the back-end > >> reports to us. If we want Emacs to be smarter, it's the job of the > >> application, not of filenotify.el. > > > > Well, filenotify.el shall abstract from the different back-ends. Being > > quiet when the native rm-watch fails seems to be appropriate. > > I've checked, all three Emacs libraries inotify, gfilenotify and > w32notify return an error when *-rm-watch detects a problem. > `file-notify-rm-watch' could propagate this error. The manual > shall be extended then. But the issue comes up before you remove the watch. You have a watch that is in fact inoperable, but the application might not know about that, or get hit by a signal out of nowhere. So I think having a validation function is a good idea. > At least inotify removes a watch internally, when it detects that the > file/directoy to be watched does not exist any longer. That's a bug, IMO: it shouldn't. > gfilenotify and w32notify do not seem to to care. In w32notify, I did that on purpose: it's not the business of the tail to wag the dog. Low-level functions has no business calling higher-level APIs on their own. > Shall we unify this behaviour? I'm not in favor of the inotify > behaviour, the libraries shall raise a final signal instead that the > watch is stopped. filenotify shall propagate this then, for example as > `stopped' event or something like this. I don't think you can easily raise a signal. I think we should provide a validate function for the applications to use. > Last point, I've observed that inotify and gfilenotify raise a > `file-notify-error' when needed. w32notify raises a `file-error'. > Shouldn't it raise also `file-notify-error'?. Yes, it should. ('file-notify-error' didn't exist when I developed w32notify.c.)