GNU bug report logs - #66381
29.1; Auto-revert not polling files when notifications are enabled

Previous Next

Package: emacs;

Reported by: Daniel Jacobowitz <daniel.jacobowitz <at> gmail.com>

Date: Sat, 7 Oct 2023 01:27:03 UTC

Severity: normal

Found in version 29.1

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Jacobowitz <daniel.jacobowitz <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 66381 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled
Date: Mon, 9 Oct 2023 14:17:17 -0400
Thanks for the follow-up!

First of all, for anyone who stumbles on this, inotifywait's
documentation says it listens to all events by default. But it doesn't
request IN_UNMOUNT unless you use `-e unmount`. That confused all of
my test results - that's why I thought the event was never generated.
In possession of this new knowledge, I verified that an unmount event
is delivered to inotifywait when my filesystem daemon restarts. So
that's great progress.

I built a patched emacs and tried unmounting the filesystem. Emacs was notified:

file-notify-handle-event (file-notify ((1 . 0) (unmount isdir)
"/google/src/cloud/dmj/emacs/google3" 0)
file-notify--callback-inotify)
file-notify-handle-event (file-notify ((1 . 0) stopped
"/google/src/cloud/dmj/emacs/google3/file.txt")
auto-revert-notify-handler)
auto-revert-notify-handler ((1 . 0) stopped
"/google/src/cloud/dmj/emacs/google3/file.txt")
file-notify-handle-event (file-notify ((1 . 0) stopped
"/google/src/cloud/dmj/emacs/google3/file.txt")
auto-revert-notify-handler)
auto-revert-notify-handler ((1 . 0) stopped
"/google/src/cloud/dmj/emacs/google3/file.txt")
file-notify-handle-event (file-notify ((1 . 0) (ignored)
"/google/src/cloud/dmj/emacs/google3" 0)
file-notify--callback-inotify)

It works! Thanks!

On Sun, Oct 8, 2023 at 8:38 AM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi,
>
> > The problem is, that in Daniel's case we get no information that file
> > notification has ceased to work for the re-mounted file system (no
> > IN_IGNORED event from inotify). auto-revert-notify-watch-descriptor
> > still exists, and auto-revert-notify-modified-p isn't modified any
> > longer. Therefore the file is not reverted even while polling.
>
> I've debugged further, and it looks like there is a gap in forwarding
> the IN_IGNORED event from inotify.c to filenotify.el. Oops.
>
> Daniel, could you pls try the appended patch? It shall enable this to
> work, meaning auto-revert-mode is informed about the unmounted file
> system. I've tested with an NFS mount, 'tho.
>
> Best regards, Michael.
>


-- 
Thanks,
Daniel




This bug report was last modified 1 year and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.