all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: muir@mnd.rs, emacs-devel@gnu.org
Subject: Re: OSX FSEvents file watching support
Date: Thu, 18 Jul 2019 16:46:41 +0200	[thread overview]
Message-ID: <87blxrpfhq.fsf@gmx.de> (raw)
In-Reply-To: <83imrzwh3m.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jul 2019 17:30:05 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Btw, just between us: I'm much less enthusiastic today about file
> notifications than I was a few years ago.  Since this feature was
> introduced, we have learned about too many problematic cases that
> together spell out one simple truth: these facilities are not scalable
> enough.

Sadly, I must agree. One proof of this is, that even after years we have
no stable test case in filenotify-tests.el for arriving of mass events,
especially file-notify-test09-watched-file-in-watched-dir. Also other
test cases are flaky; I have adjusted them again and again over years.

Maybe we shall emphasize much more, what is written in the man page of
inotify:

--8<---------------cut here---------------start------------->8---
       With careful programming, an application can use inotify to efficiently
       monitor and cache the state of a set of filesystem  objects.   However,
       robust applications should allow for the fact that bugs in the monitor‐
       ing logic or races of the kind described  below  may  leave  the  cache
       inconsistent with the filesystem state.  It is probably wise to do some
       consistency checking, and rebuild the cache  when  inconsistencies  are
       detected.
--8<---------------cut here---------------end--------------->8---

> For me, the last straw was when I tried to watch a log file
> of building the Boost library in auto-revert-tail-mode -- this
> completely broke down because there were many events each second, both
> due to changes to the log itself and due to files being
> created/modified in the same directory.  Polling, OTOH, had no problem
> dealing with this situation.

We have already some defence mechanisms to handle such situations (I
believe). Maybe we shall implement better, in order to fall back to
polling automatically in case something unexpected happens.

However, this is nat basic file notification, but the upper level, auto
reverting using file notifications.

> I'm the last one to discourage someone from hacking Emacs, of course,
> but I don't consider adding yet another file notification back-end
> such a cool feature, given our somewhat disappointing experience.

OTOH, file notification is good if it acts over a limited set of file
changes. Whether recursive directory tracking belongs to it - I don't
know. But the proposed use case, lsp-mode, could fall into that category.

Best regards, Michael.



  reply	other threads:[~2019-07-18 14:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  4:18 OSX FSEvents file watching support Muir Manders
2019-07-17 19:26 ` Michael Albinus
2019-07-18  9:35 ` Eli Zaretskii
2019-07-18 11:31   ` Michael Albinus
2019-07-18 12:00     ` Eli Zaretskii
2019-07-18 12:16       ` Michael Albinus
2019-07-18 12:30         ` Eli Zaretskii
2019-07-18 14:14           ` Michael Albinus
2019-07-18 14:18             ` Eli Zaretskii
2019-07-18 14:29               ` Michael Albinus
2019-07-18 14:55                 ` Stefan Monnier
2019-07-18 15:03                   ` Michael Albinus
2019-07-18 14:30               ` Eli Zaretskii
2019-07-18 14:46                 ` Michael Albinus [this message]
2019-07-18 15:14                   ` Muir Manders
2019-07-18 15:28                     ` Eli Zaretskii
2019-07-18 18:04                       ` Michael Albinus
2019-07-18 14:38   ` Muir Manders
2019-07-18  9:54 ` Mattias Engdegård
2019-07-18 11:26   ` Michael Albinus
2019-07-18 11:52     ` Mattias Engdegård
2019-07-18 14:53   ` Muir Manders
2019-07-18 15:06     ` Stefan Monnier
2019-07-18 16:47     ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blxrpfhq.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=muir@mnd.rs \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.