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: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 66381 <at> debbugs.gnu.org, Daniel Jacobowitz <daniel.jacobowitz <at> gmail.com>
Subject: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled
Date: Sun, 08 Oct 2023 10:24:32 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi,

>>           (if buffer-file-name
>>               (and (or auto-revert-remote-files
>>                        (not (file-remote-p buffer-file-name)))
>>                    (or (not auto-revert-notify-watch-descriptor)
>>                        auto-revert-notify-modified-p)
>>                    (if auto-revert-tail-mode
>>                        (and (file-readable-p buffer-file-name)
>>                             (/= auto-revert-tail-pos
>>                                 (setq size
>>                                       (file-attribute-size
>>                                        (file-attributes buffer-file-name)))))
>>                      (funcall (or buffer-stale-function
>>                                   #'buffer-stale--default-function)
>>                               t)))
>>
>> When buffer-file-name, revert is true iff:
>>
>> 1. auto-revert-remote-files or the file is not remote
>> AND 2. there is no watch descriptor or a notification was received
>> AND 3. some details about auto-revert-tail-mode OR t
>>
>> If auto-revert-notify-watch-descriptor and not
>> auto-revert-notify-modified-p, then the file won't be reverted.
>> auto-revert-handler does get called by the polling timer, but it
>> doesn't revert.
>
> That's not what your sentence said, which I said wasn't true.  You
> said something much more radical:
>
>   The implementation does not poll if there's a notification registered.
>
> Moreover, the documentation says that "polling is used even if
> notifications are enabled", and that is true regardless of whether the
> file is actually reverted or not.
>
> IOW, the documentation describes the usual case, where notifications
> are enabled and the watch descriptor is valid.  It says nothing at all
> about your situation.

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.

You have a wokaround which seems to work. Another approach would be use
polling only for the given mounted file system. Adding "^/google/src" to
auto-revert-notify-exclude-dir-regexp might work.

Best regards, Michael.




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

Previous Next


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