From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 06 21:26:56 2023 Received: (at submit) by debbugs.gnu.org; 7 Oct 2023 01:26:56 +0000 Received: from localhost ([127.0.0.1]:53085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qow5o-0001Yh-0E for submit@debbugs.gnu.org; Fri, 06 Oct 2023 21:26:56 -0400 Received: from lists.gnu.org ([2001:470:142::17]:36792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qooPJ-0008SE-6R for submit@debbugs.gnu.org; Fri, 06 Oct 2023 13:14:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qooOr-0004iQ-80 for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 13:14:07 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qooOk-0001cu-Gs for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 13:14:04 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-53b32dca0bfso1665759a12.0 for ; Fri, 06 Oct 2023 10:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696612432; x=1697217232; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=EvzexdByw060sPGscCBZX8ncW6h+K4JkiCX8NYapR9M=; b=VFc7qq1+jg2xSpTqpQ2S7x2Qp/JS+H+qGVrLghs+PL+M8TzM3SFwhmx4LckuuALWeT 5HwSSkABHVJ9sW357aScDF+JzM/i5086vL5TPjiF3w3HgLPRhQisHd/lc/eAZClATMMj X2i7q+BEqPJYJUjbM9ox6ARmY4JYJPZV5xUq5I2/kBcv84ALUhJc9vXhW99nqmn7jehP hKdNZDYOiqxvpWoDmUz/3HjGLvrw1KHJxNDKILRzrepNaHhtyFRnjxMOgg42CbYCUaAh cW0A2cmv9vUen1fQ+1qPyzjLwc0l4nGkUpOeu49xdzGhbbd1opdOciOqjrw16q6J2SmU i0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696612432; x=1697217232; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EvzexdByw060sPGscCBZX8ncW6h+K4JkiCX8NYapR9M=; b=cYGZs7ixdf3Ibl0vyw09SeljFNVER1cXtoGopScYCsLhnScA+4czKChmQnbo/NA6Rk d/BhZ/E2KRwp3E+EqkZMw+5DEWRA7ty75zW5rvRTeKwwQHoJaBQmDYve0NuZ1FCadUkO kIAtKXaohIOen4RvxV17h+6k7F+eteLTjW8Fv7Wxn6SZJHW4jcGrGK0cX6KUGseXXEP2 mgbArnZQxHzI11YSOVHoZxaMKZ98ipn6wSuNPtoZwO7qwGzpjXGz8m75unQLjN5nxJhz bXr9etwx7jlt42cVA7GJKG4jCIeuWHfYlRuin+SFvK9EGjNSSPpv9+8AHjjGWQcE7tq2 34NA== X-Gm-Message-State: AOJu0YyvgepbIRcvqR3/n6WfNG8MedX/wMxXZcxC4hXsTtt/P2YTFSwV 7LCZ6DdcQs3+dDlAwKC5t7+7gN3BSpwOr6haHSOgXwiKS88= X-Google-Smtp-Source: AGHT+IGV7k+XyezDUTbkKNjrMI8x9XOAOO6zKicasgkk7mT0vQ+DQ6fuGxHPNOWHD7l4E7zyLS3PFJUzFdVomABKJEs= X-Received: by 2002:a05:6402:5213:b0:533:4a89:5b2e with SMTP id s19-20020a056402521300b005334a895b2emr4321022edd.1.1696612431974; Fri, 06 Oct 2023 10:13:51 -0700 (PDT) MIME-Version: 1.0 From: Daniel Jacobowitz Date: Fri, 6 Oct 2023 13:13:40 -0400 Message-ID: Subject: 29.1; Auto-revert not polling files when notifications are enabled To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=daniel.jacobowitz@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 06 Oct 2023 21:26:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I use a network filesystem which sometimes has to restart, e.g. for updates or when credentials expire. Normally, file notifications work fine on this filesystem, but after a restart the old notifications will never fire. Documentation says "By default, Auto Revert mode will poll files for changes periodically even when file notifications are used." - experimentally the file is never polled. Ideally the notification would be recreated, but falling back to polling would be an improvement. Reproduce from emacs -Q: (global-auto-revert-mode t) Open a file on the filesystem where notifications break Append to the file externally -> emacs notices immediately Restart the daemon, breaking notifications Append to the file externally -> emacs never notices This has been broken for a while. From auto-revert-handler: (revert (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) ... eventually poll Prior to bug#20943, there was a call to buffer-modified-p at the top level that checked unconditionally whether the file had been modified. Build: In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-09-03, modified by Debian built on kokoro-ubuntu System Description: Debian GNU/Linux rodete There's a bunch of local bits in our Emacs build, but I'm ~mostly sure they are unrelated to this bug. -- Thanks, Daniel From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 02:17:17 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 06:17:17 +0000 Received: from localhost ([127.0.0.1]:53210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp0cn-0001CZ-1N for submit@debbugs.gnu.org; Sat, 07 Oct 2023 02:17:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp0cl-0001CM-0R for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 02:17:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp0cM-0002mN-2q; Sat, 07 Oct 2023 02:16:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sXdK/jkUy4EzsgWgfRdn90OrcpyNImDZ/RM9+lYsuYg=; b=evB3+17Oae5p /xu2IJCWFuKqJmaE7nXT6T6kIwkwtcbGKhDZJRSwFfH/ofI+AMt7MzhpAza4cIdVmDzqPsJpJ9jrK YvHK8xOsStwLQ+iS9GaGteJeQPhO0mUpmLe3/kktWl4rtpbvdwpYhVRCyhiFtc+5WsR78Hvz7E6mt LNyHPIQYphCgdSLwENMF6JAfYVUl4gHa3w2iJibj+aN1zMFW8Ap2nPO/QGy3OHZuNlSCLS52oZhBn gOOeLcQLxchTiiiDCv00/Gz26vKWIh3ONuaL5uiMFOmpSfkoYV9C680YIqaUSSQJcDN0AB7XYJ1oA NeXsT8p7XeHfWsc0+7BK+w==; Date: Sat, 07 Oct 2023 09:17:01 +0300 Message-Id: <83jzrz0xeq.fsf@gnu.org> From: Eli Zaretskii To: Daniel Jacobowitz , Michael Albinus In-Reply-To: (message from Daniel Jacobowitz on Fri, 6 Oct 2023 13:13:40 -0400) Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Jacobowitz > Date: Fri, 6 Oct 2023 13:13:40 -0400 > > I use a network filesystem which sometimes has to restart, e.g. for > updates or when credentials expire. Normally, file notifications work > fine on this filesystem, but after a restart the old notifications will > never fire. Documentation says "By default, Auto Revert mode will poll > files for changes periodically even when file notifications are used." - > experimentally the file is never polled. > > Ideally the notification would be recreated, but falling back to > polling would be > an improvement. Michael, can we reliably know when the watch handles are stale? If not, then users of such "restarting" network filesystems will need to disable auto-revert-use-notify. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 11:16:14 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 15:16:14 +0000 Received: from localhost ([127.0.0.1]:55669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp92L-0000yM-JH for submit@debbugs.gnu.org; Sat, 07 Oct 2023 11:16:14 -0400 Received: from mout.gmx.net ([212.227.15.18]:59455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp92J-0000y4-1q for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 11:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696691745; x=1697296545; i=michael.albinus@gmx.de; bh=SmszUgHvJT4hjZK0yDU3G9XC7eNBMIq01WI/glJJfFQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=r5g6X86CPfx5LWRJudC+VhzUh4WgHO+Ol0SzGKd0ZHYBLI3wBi5jwbb4c8qkg3IhxMtVkCbCSQw RsAzmvUFINcU5k/69ZaMhiw2XhMAdp8WPfHWf2yXq+YD2reqMst4lg6/9RE2+noVMXvOfWwD7R6ws tnp799X3Fpja+zok8W9oFq2/B9U55cGgjbbbRy6eLKkpFxsMkQjNSaTyD+77XfMd3zx49lK6HynNt GxvheRH/dIR+rlaYtys8rhSNsDmUhtnhFGgzESQY3Wm23QTzy/I0nmbkJWyWVoxcXbgi0kpioegtY sUWrkWakj2aAEYFHgEPtqrwWRmOTvIvwhjdA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N33Il-1raCtx2uCr-013LwT; Sat, 07 Oct 2023 17:15:44 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: <83jzrz0xeq.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Oct 2023 09:17:01 +0300") References: <83jzrz0xeq.fsf@gnu.org> Date: Sat, 07 Oct 2023 17:15:43 +0200 Message-ID: <87bkdaihuo.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:wywQQQnPsfaKr3eG1skB+jTa59SaCJcJx+/MRrsLABP+iBjSaZX sJPu/mKehJtvUqpMXM1e3zZhfXXbwB8zfmIKlr13PRCqChQLg+WktWkqzUEv10Pel93No/E utXI9S2PCF0lwvFwlfPse8GqyHGEN2QBUs+nb/nKMg0gQN8P0ilmOnZFpUv9foVkphH4ksd PoppZBs6vnBoXOxwfXmcw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:vwhMYFZs/Cw=;6mCNwFbMZkdDLM3PK5EtNIUjjXY /bsV+gGE4CE/AhAXhZHT/wCHfokzErZk56qCwemnQLT8UFnXBXzI51oFuAvqg6b52sp+5BeE8 v7Pe+rH3rl6MSqZRPZC2lB9PiWJTEdH/VAeS+Ti4nX0crOwc4LpW8esQ4K9Ls5N93G1iL54rA 8B+mEw/gDHVvj0tD9wiVSNb5BEHZVTzpKL0PjJiAggM0nPpeDA6SI5uiLgqO0LcvLVdQYCf+T QvD5C35IaMf5MoTp3vER2JqlZk9XcQDC2QS3JiIA5gbOxqlrffw1YUhDk7ZCtfR28Q0nIRrnU wO7q7buI7VPNWoaUF7VxyaHBJUGEYgiBpkyIRRkOwO/+qBlUWUDaEENcn4QRlWcaoIsc80+Qv EVheFdGrNsJw8WynWkow60Ane7yHGHpYAhvmAQemB2Unhp3wmcgj2OGnFkYMmHTx+LmlRs/d1 AJqzcQU5IHgqD/CEk9tR5zntkrmNA5J1h9wdOb0iWrC+CnBUVkrnNO/B2NsPC31bZymg8qiTt +AcjcHsuoV8FwFmqa3Lo1LRaiIbLWhUwcIfzUzs/S2g4axGNm0u3bZ/RwoXg0FaUUeNT2a0CN VENNS2VHCPtVIcmJEyBgjqnl7Xcp4aUTvdnfmD5iwvleJwhEDnwr1TZa8XZbHhBnqOfQpOe9s Eqh8WWv/YiC4OiJr2lP5KU2BV8vYbppNALhuBa0wcV5ONvpFnQiRik00/DpwceoTyOF1RXPrX f2uoRNpdinQ9APgRttnoVuVtlcYABqfT1QL7HFUykAN7bU45scNOMgT85Larf8sNgo4owSHAC Tz5NsCsYB1xdIW3IXHGpQxJOZJVBg1P8oR9lNoxQp08qjMPpVkff8227qZcNypYRFlZfdC1Ak nW3mJHJmeUeP7Q2E3BHetK8Xp8VBpZtIGoBtLbdaFPRgHkdcUBjDe1VAV1k7LQRdSbs1t9Ddb ZS/LZPFqMdWgL/Qmu4Y2nuUtx3k= X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Daniel Jacobowitz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.2 (--) Eli Zaretskii writes: Hi Eli, >> I use a network filesystem which sometimes has to restart, e.g. for >> updates or when credentials expire. Normally, file notifications work >> fine on this filesystem, but after a restart the old notifications will >> never fire. Documentation says "By default, Auto Revert mode will poll >> files for changes periodically even when file notifications are used." - >> experimentally the file is never polled. >>=20 >> Ideally the notification would be recreated, but falling back to >> polling would be >> an improvement. > > Michael, can we reliably know when the watch handles are stale? If > not, then users of such "restarting" network filesystems will need to > disable auto-revert-use-notify. We have `file-notify-valid-p'. It calls the backend specific funtion, for example `inotify-valid-p' in the case of GNU/Linux using inotify. The OP didn't tell us which backend he's using, so let's assume inotify ATM. This backend specific check does not ask the operating system, it checks only some internal data structures. This isn't a robust check for a stale watch handle. However, inotify sends also an internal event IN_IGNORED, which is raised according to inotify(7) --8<---------------cut here---------------start------------->8--- IN_IGNORED Watch was removed explicitly (inotify_rm_watch(2)) or au= to=E2=80=90 matically (file was deleted, or filesystem was unmounte= d). See also BUGS. --8<---------------cut here---------------end--------------->8--- filenotify.el translates this to the Emacs file-notify event `stopped', and if this event arrives, the respective data structures are updated. In case of a network filesystem unmount, everything shall work. A recreation of file notification after a remount is not supported. This would be a new feature. However, the situation is more complex I fear. If I understand the OP message correctly, file notification is used for auto-revert-mode. There is the user option `auto-revert-notify-exclude-dir-regexp'. If a directory located on a file name matching this regexp, file notification is discarded. File names like "/mnt", "/net/", or "/tmp_mnt/" match. So in order to use file notification with auto-revert-mode on such a location, this user option must be adapted. I haven't tested the combination of watching a mounted file system, and unmounting them, in autorevert.el. According to `auto-revert-notify-handler', the file-notify event `stopped' is handled, and auto-revert-mode continues with polling. I would test this once I see a clear recipe (starting with --8<---------------cut here---------------start------------->8--- emacs -Q --eval '(setq auto-revert-debug t file-notify-debug t)' --8<---------------cut here---------------end--------------->8--- and telling all steps how to enable auto-revert-mode and how to unmount the filesystem and what happens afterwards. The two debug options show us the story in the *Messages* buffer. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 12:52:59 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 16:52:59 +0000 Received: from localhost ([127.0.0.1]:55821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpAXy-0006n0-Cw for submit@debbugs.gnu.org; Sat, 07 Oct 2023 12:52:58 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:51210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp9xh-0005aU-Mv for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 12:15:30 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5346b64f17aso5608975a12.2 for <66381@debbugs.gnu.org>; Sat, 07 Oct 2023 09:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696695304; x=1697300104; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vcwRt65NJo2TZvX3O5E8dypFisiSgn6w7Bi/qZ3xeOA=; b=YZRBWVwiLqaB710Xx2B711Mj2GUnl9Ubn2/1H/tJKtYDmtkVpYdvj2f1YFSooiE8SE MB9xpWO9G/mcHcIiFKCF0kweZHW7rvSlIw/jmf12cy+L/VnzkSXdjdsqQzmce/1MuJIn lrp3Tgqd5Mp3ZuA9ihxWLX85BuZ8CNVtuWtX72uhCQdgfw8wMPzOHO8lRiKtVr7sIBoG +cUkMeEy4E6J1OMxirKrL6JJa3knP+PvOxL32kRUJoXSSEyMUVY7jl3A/5+Lgh7nv/Go TkYPAs9XSb7lom4pQI/cWlxxKWRd2xPyTl498g/hRv5UPeWs0nvveT4qmmq4X1mh3cM6 YGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696695304; x=1697300104; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vcwRt65NJo2TZvX3O5E8dypFisiSgn6w7Bi/qZ3xeOA=; b=Wh419GBTD8ixhZ1q6MoPP3vXApeybSYmBjx2gjnlUN3iOzemVbCE3hcm/SSdA5t27J 9GpdP4RaSWJ9RIFVlONYYZUlUEWK+3+UMuKhSwr/3+pJ7ThNLMmEQC/ud1tWjiyh5xBs Wk/ax3eTV86PeUHchwV76ft/88/Yv5BLm4jHXzGfe5/bH7pvlcw5erh6WrYelwN4rvk6 +SZAJUGSQkI8vw54UBCD/n//5nBiOcV2Ggsz65qWP06W14qB1G8JJDtUeyhf5n01jwNR JII97FolOZ8sa4VshVFFtYNjP0A7rnEFZaapAKDMEC/1PsLuUqNLUbI9J/GiyJz7XynJ RU4A== X-Gm-Message-State: AOJu0YyVpARLL1WZQJHV3WdF+I41sOvZlAj/1c/rCH0BlV1lqcyB60GL 5X8q+dna7qXmkGOjMtgOevHy8WvW4T+m0c8P0CQ= X-Google-Smtp-Source: AGHT+IHbwOI0WPzA50ARs3gBbVihJJoilr0ut5l9zYyMxz0Vj5DnzAROfeUOJ4viKhX5mQWcgHLh+/y94dSrVllurhs= X-Received: by 2002:aa7:dcc7:0:b0:533:8b78:91db with SMTP id w7-20020aa7dcc7000000b005338b7891dbmr9854520edu.27.1696695304052; Sat, 07 Oct 2023 09:15:04 -0700 (PDT) MIME-Version: 1.0 References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> In-Reply-To: <87bkdaihuo.fsf@gmx.de> From: Daniel Jacobowitz Date: Sat, 7 Oct 2023 12:14:52 -0400 Message-ID: Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled To: Michael Albinus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66381 X-Mailman-Approved-At: Sat, 07 Oct 2023 12:52:56 -0400 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) emacs -Q --eval '(setq auto-revert-debug t file-notify-debug t)' --eval '(global-auto-revert-mode t)' file.txt Modify the file outside of Emacs: file-notify-handle-event (file-notify ((1 . 0) (modify) "file.txt" 0) file-notify--callback-inotify) file-notify-callback (1 . 0) changed "/path/to/file.txt" nil #s(file-notify--watch "/path/to" "file.txt" auto-revert-notify-handler) "/path/to/file.txt" "/path/to/google3" auto-revert-notify-handler ((1 . 0) changed "/path/to/file.txt") Reverting buffer =E2=80=98file.txt=E2=80=99 Restart the network filesystem (sudo systemctl restart netfs). Modify the file outside of Emacs again. Nothing new in *Messages* for either the restart or the modification. Hit a key in the file buffer: file.txt changed on disk; really edit the buffer? (y, n, r or C-h) Same story with inotify; there's no event when the filesystem restarts. I'm not explicitly unmounting it, systemd kills and restarts the job providing the fuse filesystem. The path does not match auto-revert-notify-exclude-dir-regexp. If supporting this is of general interest, I'd do it by (A) re-enabling polling even when using notification; (B) removing and re-adding the watch when polling reports changes that we weren't notified about. If it's not of general interest, the best alternative would be removing the bit of documentation that says "By default, Auto Revert mode will poll files for changes periodically even when file notifications are used." For anyone with a similar problem, since the filesystem restarts are typically overnight as part of system updates, I went with a simple workaround: (run-with-timer 1800 1800 (lambda () (progn (global-auto-revert-mode 'toggle) (global-auto-revert-mode 'toggle)))) On Sat, Oct 7, 2023 at 11:15=E2=80=AFAM Michael Albinus wrote: > > Eli Zaretskii writes: > > Hi Eli, > > >> I use a network filesystem which sometimes has to restart, e.g. for > >> updates or when credentials expire. Normally, file notifications work > >> fine on this filesystem, but after a restart the old notifications wil= l > >> never fire. Documentation says "By default, Auto Revert mode will poll > >> files for changes periodically even when file notifications are used."= - > >> experimentally the file is never polled. > >> > >> Ideally the notification would be recreated, but falling back to > >> polling would be > >> an improvement. > > > > Michael, can we reliably know when the watch handles are stale? If > > not, then users of such "restarting" network filesystems will need to > > disable auto-revert-use-notify. > > We have `file-notify-valid-p'. It calls the backend specific funtion, > for example `inotify-valid-p' in the case of GNU/Linux using > inotify. The OP didn't tell us which backend he's using, so let's assume > inotify ATM. > > This backend specific check does not ask the operating system, it checks > only some internal data structures. This isn't a robust check for a > stale watch handle. > > However, inotify sends also an internal event IN_IGNORED, which is > raised according to inotify(7) > > --8<---------------cut here---------------start------------->8--- > IN_IGNORED > Watch was removed explicitly (inotify_rm_watch(2)) or = auto=E2=80=90 > matically (file was deleted, or filesystem was unmoun= ted). > See also BUGS. > --8<---------------cut here---------------end--------------->8--- > > filenotify.el translates this to the Emacs file-notify event `stopped', > and if this event arrives, the respective data structures are > updated. In case of a network filesystem unmount, everything shall work. > > A recreation of file notification after a remount is not supported. This > would be a new feature. > > However, the situation is more complex I fear. If I understand the OP > message correctly, file notification is used for auto-revert-mode. There > is the user option `auto-revert-notify-exclude-dir-regexp'. If a > directory located on a file name matching this regexp, file notification > is discarded. File names like "/mnt", "/net/", or "/tmp_mnt/" match. So > in order to use file notification with auto-revert-mode on such a > location, this user option must be adapted. > > I haven't tested the combination of watching a mounted file system, and > unmounting them, in autorevert.el. According to > `auto-revert-notify-handler', the file-notify event `stopped' is > handled, and auto-revert-mode continues with polling. I would test this > once I see a clear recipe (starting with > > --8<---------------cut here---------------start------------->8--- > emacs -Q --eval '(setq auto-revert-debug t file-notify-debug t)' > --8<---------------cut here---------------end--------------->8--- > > and telling all steps how to enable auto-revert-mode and how to unmount > the filesystem and what happens afterwards. The two debug options show > us the story in the *Messages* buffer. > > Best regards, Michael. --=20 Thanks, Daniel From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 13:03:16 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 17:03:16 +0000 Received: from localhost ([127.0.0.1]:55840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpAhw-0007GA-0e for submit@debbugs.gnu.org; Sat, 07 Oct 2023 13:03:16 -0400 Received: from mout.gmx.net ([212.227.17.20]:39881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpAht-0007Fu-Px for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 13:03:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696698167; x=1697302967; i=michael.albinus@gmx.de; bh=fXBMdkDz5FMdM2gIzYEaluKmyGZSQ6TjxHAnGAOGmsc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=jmt2yCnW+6IxhzETviVK+ex5NEhflwdSxG1emRI7QC9gCEPOXMZMx3DguPEirxiLnop1aswVzNS gnJ4ZzWwAKIF5aJaN+O80pQdCXxqt8w0LsLX+z5OONhI33TB3XV2IZh6+zhpurwH/nYsWY6iexpFA SW1A6n27ZAzdiki25sUOxtDY8uj44a1H6C20MAeNyv2ZFYZs+PgwWkLKxsBSJ0Ag0shEppLZ+8DC+ KJMHN0Y/T11GnJEvE2VniEqLHYM7yz2YwWK0lLYBDdB1JxHmgWuE5NtbFzE8NCdu6g34TWyhuXGTH ungoGpd/GA33gMy3QB2rWM3TaKHLsUAziTmg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtwYu-1rjBfP24eS-00uKBj; Sat, 07 Oct 2023 19:02:47 +0200 From: Michael Albinus To: Daniel Jacobowitz Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: (Daniel Jacobowitz's message of "Sat, 7 Oct 2023 12:14:52 -0400") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> Date: Sat, 07 Oct 2023 19:02:47 +0200 Message-ID: <87il7igybs.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:xJpqUYcm7FCvUF7CoqGJU+zKiUSLeogMUpNcHK1cXy3zJITCXUa 6Z0gcv33fFuFulMUqinZSWSv4D9Pbg0RTs72xDKDC1ihvWV5W0PU9zCU1YMjUNhzM4ugBFa 0dXLVmQH94G9r8eRXXJvwjXPhaCvkmklFHOpedSBG1tvFfEyX1M3JEISY5Tg6GoAJbmbKWe iB3BFMdlBzAFwIAgYMtVA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:vq951IsB+Wg=;cGKvwsypC/HJ0yOZQOcdO/dS24/ El6YA1tTwKzvtsMWRTpDgeUCRTJbAnOtkDhZEz5B9xdyp7n081GLAWtYcBYwXZmC8SGMeNZbe aYFA0FUInUSobCayBtxhACBsYbniJoQw+G2NnUpYOydHjl1uBrEaBxCqNfulcwunjrKpUynvv 65/bvMxb0HAskLdfH112IRiT4/x0U+cKPBjSQyEXYsl0g3QaJpZCxFrW8ntw/KbEkPv41ZevO z2Rs98iYHVv3/epoyp7rOcrDC+L8xFngJ26hOkovb8fTDo8Ve6yrw0vAb1NR/PZWaxdu3bZHP udEAvIzzLl588q2B3019BwWNNfA5OtYFf6UJdoXCFJbJsilMnjp+7Xy2RlDtruzXJg3imML12 WkE5T7oSKMlG1SjHAT/VnFaYdx/4c2rUoqr0WCZHQ8ix4liRhyi6YDUPc2ov0ve78OFVMQNXT zyfwJK3yTxx+LCLAPpxrCAGzJUoyCrI6PU7VHbbofh9h1n4PRZUQRrAc8VPY29rE8abpcWo4q lxTBV7jVlrexvLIRm3VUmw7YdSOCfMZwfI2eEA5tnn7CT/ZO7xZumjxKCGEQ7vGI7hkQmVgkP pO2lwIbnnoQxWvmAkz0PLBKeIDMEFzKq/yl3ckTdegLoudDpkVR+JjqzwVy0Zn55r+bsVXEKa qitDnoJqn77/NrmzJvW+Cb/Ti8BH/HBFEuwXJ3NqgL7khi3QvLBOjoUW+tp2ygdGxaykH0vVM fvabBVhaJxwiq7q/yvNjl6JEGtbkwutmqzg06I8oovmZBRZDfISZ7blVi8ZGD9UOz9WJ4i4KG OCLfQTxP7HEff/dizp7FwjBkwvv2HZRRlRaV09D2sSym/B045N4JyfKgbCA7JWC2zUNC40cSs p3r4W8lRkm6V7grvFvaPb7OF0REbGHW0Hyu6NpxnT8TRexzxj0q+GlbDUdcCVdatPxcrAT9M2 X5VBZtO9Qtpdl+Q03IkwrhL+Qb8= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Daniel Jacobowitz writes: Hi Daniel, > emacs -Q --eval '(setq auto-revert-debug t file-notify-debug t)' > --eval '(global-auto-revert-mode t)' file.txt > > Modify the file outside of Emacs: > > file-notify-handle-event (file-notify ((1 . 0) (modify) "file.txt" 0) > file-notify--callback-inotify) > file-notify-callback (1 . 0) changed "/path/to/file.txt" nil > #s(file-notify--watch "/path/to" "file.txt" > auto-revert-notify-handler) "/path/to/file.txt" "/path/to/google3" > auto-revert-notify-handler ((1 . 0) changed "/path/to/file.txt") > Reverting buffer =E2=80=98file.txt=E2=80=99 > > Restart the network filesystem (sudo systemctl restart netfs). Modify > the file outside of Emacs again. > > Nothing new in *Messages* for either the restart or the modification. I miss messages like --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify ((2 . 0) stopped "/net/garfunkel/Mult= imedia/foo") auto-revert-notify-handler) auto-revert-notify-handler ((2 . 0) stopped "/net/garfunkel/Multimedia/foo") --8<---------------cut here---------------end--------------->8--- which I see in my test. "/net/garfunkel/Multimedia" is the mount point. What is "/path/to/file.txt" exactly, and what is the related mount point? You might send this information privately, if it is disclosed inform= ation. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 14:00:05 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 18:00:05 +0000 Received: from localhost ([127.0.0.1]:55866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpBau-0000gk-S6 for submit@debbugs.gnu.org; Sat, 07 Oct 2023 14:00:05 -0400 Received: from mout.gmx.net ([212.227.15.15]:34313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpBat-0000fg-5V for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:00:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696701576; x=1697306376; i=michael.albinus@gmx.de; bh=YzD/kh8yMoh1o5TDPqboGmCtY+0vVuzRYmX2wOa+DCA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=SqBvOjAQ49R7/OQHADQaLORAQy8+QI0NiWpa6mCNGa/ul1+icYCs5fg5W0DQXChnNO/bNMOLG4u PswhKtGnIEiGk+iJhGUyoQR7uiSzz70gYjDoMInxskWP3Li/mVijCFY6ua39MILbpD1Vp0U0C6TQD IPMtOPLGxnBVMgfA1+QpemsDuURKnDpLKSIdpwy9tPHjayuh0UomMaej+PlnfEN4agUpjO86s3PNj +VTarVLBzduVXu9e3qR4FerMzoS3dChApZdUhFmwUnupjJvzY0pg+SzPVjr0dh8AEvmIUnT4gf6uf 8DgLa6b8LiUpNMkYDb1wEOvEKFT+HU/FNsIQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MZktZ-1r3qTH2Snv-00WmAg; Sat, 07 Oct 2023 19:59:36 +0200 From: Michael Albinus To: Daniel Jacobowitz Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: (Daniel Jacobowitz's message of "Sat, 7 Oct 2023 13:28:02 -0400") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> Date: Sat, 07 Oct 2023 19:59:36 +0200 Message-ID: <875y3igvp3.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:nMBLPQZYVImvA7XmlbIawJrovmn7Xib8pML1bZUj/TIMPo/xrZ9 4srIBLoHAGQmUtl1EEhVjrV/rxg+x0b1W0+4TTqefpFRaYc1hZxZ7EJkGZCjNJZM/aUzZ5V WfbXaSF1BW+FiNQfMgBIYYrTbjyRLBhu1a1mAu1PlQwutp9uVNhE8/y4Bx4i+LMAfTdwwJy lv8k1NdpGEZECW7/HTJtg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:QKYLj9hWaNA=;EgouRgNA9BzV9KGyODsO+Dd0/Y1 wc9+WYonCZz8/AaAHd8VWWjzilh+kO66/Va4ygrRugvCnemwOYxwCkH50tnnRtXBbyQKwvT/l XoEyI3a5h7GiOsrXJmPQHbG15+HtOYaWAaGHXXsMzCFQYbkSlRHgcgvYsL46q4Rm2ueyi1bED L3H464BLeUROJOka00e7pjSZAgnKPGP41q4Ldk1CbSLoeDn5vYAYS4Wxkz9ruRVTBk/+hJkMS Kn9R0O8es1v9+S1TgnDgwiuSLPUmI1H+/WfCwVYdkyNKyLb6IsrQNWSU1+PiD5yJTBZ/Jfvc/ 3dFLMuhDv31piozLc6wXW2WBJIjRcqTA6s1e9ZjUcORWEztvY8BasXJJd3GZrLhmcKl/ZKOTl 28S9E3G8QFC4wMTptM9TeJf/VUOiDuG18V/JFb8Y0pXIkTMYxmx0HYUVZvzJ/VwnE1BxMV81E 8qnj9nYCVhHaC22hK8W0HppUQjxzNLF/C/HBzn1KHLqCi6FFqHm+Re9yqkDVNOperLg9xm5Zv 7Ecd8lLD7+lzD/jFhcuQgt2akt+Bm9OGdklKJhGqZ17Q3MjBXL5qIchKDRZ/aqE5F6hQ62IAj 0rmVdCDHVK1LqwT0JxJYiK8cq7m6rA5ICGo2pf/0uNzx3I0usv2j5DqeXhRJ/d1PcWgl+eihI LS8V9qxXJ1PWuC1pC52VidMokmyv9oXzqjcjwWRLDJbnMY/tG/Ab2pVp0FHiqBlIwQM0Uzqsb m7irRRFiBcOKw3X1ePDvCPdEpJlnZL3CvOHLDosaXgnjhfya+qVNXHSkjrTmPO+uD/ik14FBw tSbu/xSKvkUYEuojM7lauFlLiqkVl3vKnqvJ93Lh2gL8Of6Kiroz4f1dmYSu2FfDXAPHaaRu0 0MFrmzGxcCbOfHnJwFf4DnWDSjHqQnsKS51sVebeSA+gQcExZVRXMgrwU/ExZdrQynSF95q+h 4pI7Sw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Daniel Jacobowitz writes: Hi Daniel, > It's /google/src//file.txt, with the mount > point on /google/src. Mount details: > > srcfsd /google/src fuse.srcfsd > rw,nosuid,nodev,relatime,user_id=125,group_id=0,default_permissions,allow_other > 0 0 > > There's no stop notification generated, whether I restart or kill the > daemon or just umount -l. inotifywait(1) agrees. I've got no idea what > parts of this may be local kernel behavior versus FUSE in general, but > I would guess that FUSE in general is more likely. Yes, likely this is due to the srcfsd FUSE type. I don't use it, so I cannot test. Since inotify doesn't deliver IN_IGNORED (and the file-notify `stopped' event doesn't appear therefore) we cannot do too much. We have no API which sends heartbeat checks on watched file systems; such a check could solve the problem. But there are no plans. Your workaround by restarting global-auto-revert-mode every night might be the best you could use. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 14:28:26 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 18:28:26 +0000 Received: from localhost ([127.0.0.1]:55894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpC2L-0001c5-Ti for submit@debbugs.gnu.org; Sat, 07 Oct 2023 14:28:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpC2K-0001bp-VQ for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:28:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpC1w-0001C8-3J; Sat, 07 Oct 2023 14:28:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1ddevJsrPpkrvB8fDdF00iSiFjayDvp1vsQnzSWfwvU=; b=eMhCD9Zsd3dQ ccw1ucQQLMibUbVfR/dicdLHIHuoYkIVlJKOq129o/KreaQECgGNY9FweEokAOvIENkNagiubB1l6 Wj8EqLtdAaC3QjhmPXlvG3VOwa4s27bemlqzg4xWcVtHgfyzmYUJBBHrKBSUC+NrGQ1P6rhq6IGNV /MkWrB46Xhb8SWOTrja/TcSG+sjgRa93TFRSKrPGh592j3dYJ85HLJiSHkl3VyG3g8QAPO0GFjq4S MpT4P3WVtqLWBwCib2DD87kmli1KGkYbXz8jw2dnMADmf3f9w7umbtFNkO8o7nU3XVRVB+4UA/fWg OCmqIDugjwlIok1f8lT3sg==; Date: Sat, 07 Oct 2023 21:28:13 +0300 Message-Id: <83fs2mz3r6.fsf@gnu.org> From: Eli Zaretskii To: Daniel Jacobowitz In-Reply-To: (message from Daniel Jacobowitz on Sat, 7 Oct 2023 14:14:45 -0400) Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Jacobowitz > Date: Sat, 7 Oct 2023 14:14:45 -0400 > Cc: 66381@debbugs.gnu.org, Eli Zaretskii > > Coming back to my original suggestion: the documentation says that polling is used even if > notifications are enabled. The implementation does not poll if there's a notification registered. That last sentence is not true. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 15:01:25 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 19:01:25 +0000 Received: from localhost ([127.0.0.1]:55926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCYG-0002xN-Hk for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:01:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCYE-0002xB-8A for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 15:01:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpCXn-00085O-Jt; Sat, 07 Oct 2023 15:00:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5MkAnqxiWmQGJ8h7x3vdiXLeIrOSt50xNLQQE3MnQFM=; b=SEcpGy+lMfo5 vd+XHASnDkpv27tF5Vxkg3dIv+NY1oF9/GKLfmvqkS+v/DBdUKnCKLfUjxpBcOrcL+Do/xhUu1CXy F92DDjVExUEqyJthapR4yPlLJJWBk+LxHRdyC8xS1s6htauf0dTCTESJddBKBW7c87QmuRn7UAj3v kL/uOD0T7KGaYmevmHu4G/kdZxA7FTrBA0i16ftW/lAObwbBfCm5Wk+gpAP35rwk3S55Nbs1xkwZw lgu8brXXZefKmIjhWUxefKV96rjHy997HneFFk6x+jJaTxO8HsUfGhJ6Iibh6zhKRtQ3aWr5+avxc 6fc3Ve29DFG/oRv7ebu2EA==; Date: Sat, 07 Oct 2023 22:00:39 +0300 Message-Id: <83edi6z294.fsf@gnu.org> From: Eli Zaretskii To: Daniel Jacobowitz In-Reply-To: (message from Daniel Jacobowitz on Sat, 7 Oct 2023 14:41:35 -0400) Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Jacobowitz > Date: Sat, 7 Oct 2023 14:41:35 -0400 > Cc: michael.albinus@gmx.de, 66381@debbugs.gnu.org > > In auto-revert-handler: > https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779 > > (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. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 15:20:11 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 19:20:11 +0000 Received: from localhost ([127.0.0.1]:55946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCqQ-0003UD-Es for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:20:11 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:59659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpBpi-0001EY-EP for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:15:26 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53808d5b774so5819999a12.3 for <66381@debbugs.gnu.org>; Sat, 07 Oct 2023 11:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696702497; x=1697307297; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SqLqNED2jwapSlb4h87qLoYAdumQmGWScoEgoLJY+6Q=; b=UpKzNOSkQSg2EQ94V+exzaXdhzXnyLn9JEItAHn09d1LSdpztABY3sjR9vMliRRmkq 2S310P8rwbCzVf2GabhFH97dD5ydCaJcV4vFFEuPs3WHmjNkp+S94Gjws9MaF+LuiNEh 1wTpZMp56OvZtuUtvyf0oxnBqslCpKHjg9pRkt6AEV02mRYH9tT9bsAMBgSUmaGjxCch +4tAbLZe17UTn7eC0JfujuGWQXcSN2NXOZxQm7Ywln91Uq0jOSpJOTlZTORxLLt+J4sh wQqIWGtgW3tdyZIpQqRaBNcVdb4Lsg9EZG+dZUrBp6ftxj1g3YN6k6nMVq/YDf3FATt+ dhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696702497; x=1697307297; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SqLqNED2jwapSlb4h87qLoYAdumQmGWScoEgoLJY+6Q=; b=APaSmiGmpRridAu6mCMX4rd863M8fOA79DLNVqlAc935cpYn3+sm2bCNQAtBLoyGVk zRDBBj5e49pXIBNAZnttO+aCqxdjfmHxX8cHOGpXhUV7FD6SYvucjcneegZWtojnYTcv /u3fBlIXWU27Duw/sISG8OMXyFaKXWGpzqsH6TLMuxsELHNj90DNUqSAbdOtmKhO6d0a nvjZF0IUQCvJc9lvkogEpNh4saYTujKBlp1nvZz0Dv4kC0ULEJbF40UI++0MEz3fYf3O stksx0s+pUI27wSvIPQx8UWCnf1yiLDL14TG+CEQR78eP3mIDVh3V4zAIgiohkvTIfYq w5xA== X-Gm-Message-State: AOJu0YxXDd6d8KA8WP7FZn5AMOi62nduhUacGfaBRSVE1jWNB4/b6/CH U/z22TNbNzEw4jIZyIPIf+kPd2IeV5IKWrcwjXt1iMhs X-Google-Smtp-Source: AGHT+IG8cWQHkfBsBSsu2+3Gq5Y29OhEAhLD2RK8raB8X9DlpffXEtxduoOHSlhXDpEGSyWqgimxXohde6+9zn/cJKA= X-Received: by 2002:aa7:d151:0:b0:530:db58:61c8 with SMTP id r17-20020aa7d151000000b00530db5861c8mr10703192edo.23.1696702496927; Sat, 07 Oct 2023 11:14:56 -0700 (PDT) MIME-Version: 1.0 References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> In-Reply-To: <875y3igvp3.fsf@gmx.de> From: Daniel Jacobowitz Date: Sat, 7 Oct 2023 14:14:45 -0400 Message-ID: Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled To: Michael Albinus Content-Type: multipart/alternative; boundary="0000000000009e75e00607245534" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66381 X-Mailman-Approved-At: Sat, 07 Oct 2023 15:20:09 -0400 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000009e75e00607245534 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Coming back to my original suggestion: the documentation says that polling is used even if notifications are enabled. The implementation does not poll if there's a notification registered. Which behavior is intended? On Sat, Oct 7, 2023 at 1:59=E2=80=AFPM Michael Albinus wrote: > Daniel Jacobowitz writes: > > Hi Daniel, > > > It's /google/src//file.txt, with the mount > > point on /google/src. Mount details: > > > > srcfsd /google/src fuse.srcfsd > > > rw,nosuid,nodev,relatime,user_id=3D125,group_id=3D0,default_permissions,a= llow_other > > 0 0 > > > > There's no stop notification generated, whether I restart or kill the > > daemon or just umount -l. inotifywait(1) agrees. I've got no idea what > > parts of this may be local kernel behavior versus FUSE in general, but > > I would guess that FUSE in general is more likely. > > Yes, likely this is due to the srcfsd FUSE type. I don't use it, so I > cannot test. > > Since inotify doesn't deliver IN_IGNORED (and the file-notify `stopped' > event doesn't appear therefore) we cannot do too much. We have no API > which sends heartbeat checks on watched file systems; such a check could > solve the problem. But there are no plans. Your workaround by restarting > global-auto-revert-mode every night might be the best you could use. > > Best regards, Michael. > --=20 Thanks, Daniel --0000000000009e75e00607245534 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Coming back to my original suggestion: the documentation s= ays that polling is used even if notifications are enabled. The implementat= ion does not poll if there's a notification registered. Which behavior = is intended?

On Sat, Oct 7, 2023 at 1:59=E2=80=AFPM Michael Albinus <michael.albinus@gmx.de> wrote:=
Daniel Jacobowi= tz <dan= iel.jacobowitz@gmail.com> writes:

Hi Daniel,

> It's /google/src/<censored>/file.txt, with the mount
> point on /google/src. Mount details:
>
> srcfsd /google/src fuse.srcfsd
> rw,nosuid,nodev,relatime,user_id=3D125,group_id=3D0,default_permission= s,allow_other
> 0 0
>
> There's no stop notification generated, whether I restart or kill = the
> daemon or just umount -l. inotifywait(1) agrees. I've got no idea = what
> parts of this may be local kernel behavior versus FUSE in general, but=
> I would guess that FUSE in general is more likely.

Yes, likely this is due to the srcfsd FUSE type. I don't use it, so I cannot test.

Since inotify doesn't deliver IN_IGNORED (and the file-notify `stopped&= #39;
event doesn't appear therefore) we cannot do too much. We have no API which sends heartbeat checks on watched file systems; such a check could solve the problem. But there are no plans. Your workaround by restarting global-auto-revert-mode every night might be the best you could use.

Best regards, Michael.


--
Th= anks,
Daniel
--0000000000009e75e00607245534-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 15:20:11 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 19:20:11 +0000 Received: from localhost ([127.0.0.1]:55948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCqR-0003UH-6g for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:20:11 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:55401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCFg-00029i-3H for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:42:12 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-536b39daec1so5558634a12.2 for <66381@debbugs.gnu.org>; Sat, 07 Oct 2023 11:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696704106; x=1697308906; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qBXtsTU5HYG9JAGCiKHWIj7qkcRg6MnqJh+N0KKyW7I=; b=FSoDWmnzTH+T5OjW3LvzyJAXe0oduRSi991AXnnE0YhR0M/NvUmDA7tkgS8Kd8WpRE 7Yrc/tJ/0PegPAseqzE8fvFH6+5E2NVWzVgafDbEI0s6a2WuPVA+3asjRfWf25NW3eeC yP1laqySB6o1i80meaTTOMLPFJaS3brLfxoUOff7MOnzcb/ZsVJhGyRASkJq557fNTT/ /jXJUmDDdVpYFYcFiFhuJE8/fbzXcQHjjtc6P/qtC2u8dxrHslpkDHjbyEWheIXtuv14 +xlxspd0hiZqlIweelH3NjW8BmWTV+jr5WOoCLswts58aDidHXRB1nOewrce6cWo13yV NT4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696704106; x=1697308906; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qBXtsTU5HYG9JAGCiKHWIj7qkcRg6MnqJh+N0KKyW7I=; b=DtNJy3Ewc30oQx64YtiNwNrXXa988f5wISNqhFdX3pyr90glQZjnjb/3rhrxXu91q1 QhB0Qw4FL3uEwCM0h0OzkBnjEC6iuCGbbyIAfeqnUMDz1QnrTPHDSJy6nEVWQcGzx5by Vo4cA8xJpTLxFXnLZE4PmrYaGV+rffSnilRDctig65WhJ0J7bfyp5vJY1tKeagHOWrvI P7guU7jrOPusshJclzWUhbFG1gWx5vt9wHDG3sj4/EondtVPWXJhIV/kC3PRD98r0vNo AG5DnaGgtTPbquj513494XT+UL8/9G1ycwyn+Wu1eMcDIm42Brvs+7Abt0f4PPySritL FoaA== X-Gm-Message-State: AOJu0Yy9QvitGa9Y3J4CWJo2wv1CAnAKlU4hnih2Iksd8owNvEFQ2wMm vTkoKWTFADjeKgvLN+/G88FdBpSL6h0Bi+7khO0= X-Google-Smtp-Source: AGHT+IHie3BdB9GvHlHa/LPyj670mNAvaQZ+R12w2/9rgX0wxjPjjBkihte7wD4oQ3U61kwE3c4/pfmdlt0l7ra5A9o= X-Received: by 2002:aa7:c0d2:0:b0:530:e2e3:28af with SMTP id j18-20020aa7c0d2000000b00530e2e328afmr9607018edp.31.1696704106277; Sat, 07 Oct 2023 11:41:46 -0700 (PDT) MIME-Version: 1.0 References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> In-Reply-To: <83fs2mz3r6.fsf@gnu.org> From: Daniel Jacobowitz Date: Sat, 7 Oct 2023 14:41:35 -0400 Message-ID: Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66381 X-Mailman-Approved-At: Sat, 07 Oct 2023 15:20:09 -0400 Cc: 66381@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Isn't it? In auto-revert-handler: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779 (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) (/=3D 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. On Sat, Oct 7, 2023 at 2:28=E2=80=AFPM Eli Zaretskii wrote: > > > From: Daniel Jacobowitz > > Date: Sat, 7 Oct 2023 14:14:45 -0400 > > Cc: 66381@debbugs.gnu.org, Eli Zaretskii > > > > Coming back to my original suggestion: the documentation says that poll= ing is used even if > > notifications are enabled. The implementation does not poll if there's = a notification registered. > > That last sentence is not true. --=20 Thanks, Daniel From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 15:20:12 2023 Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 19:20:12 +0000 Received: from localhost ([127.0.0.1]:55950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCqR-0003UO-Pj for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:20:12 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:56725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCMG-0002Rs-Tg for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:49:01 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so5631292a12.1 for <66381@debbugs.gnu.org>; Sat, 07 Oct 2023 11:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696704515; x=1697309315; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tMB1+AMOTk10esGd9/WxGyYSHcfDTtNEvdJIsEfkfSM=; b=GZ76NhQKgd7g829HoLgl5lRWCmrTFHIqMaUYh4v9KwR6r1WyR+we6MBx/QJ6gbB6SF lmGX62CsRo4s/JLHVb+hbbI7fyYgPhEcr8YQC4jmvt2znlZhC1xRqupVlBZ43FEKbIGe KZOW7KLgoLLb25uT5NqJ97wwx2MYKofIAYxVjaPIe+Ga4pCZYBNjjYc0t8Qilr7jaQxY ftsJ8LhHo93V/9GQTEiR5ZMUaal8sJzEC3xbIW4uOLVnjZvCZpzjPcffvt98vkoNA6zT Uvj0gFv95qOA369ZlzQViWTiYxGVqJS/DOz94jIyODIKPFYPnhpM32Vyb9InvYqgY6iK GXlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696704515; x=1697309315; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tMB1+AMOTk10esGd9/WxGyYSHcfDTtNEvdJIsEfkfSM=; b=oQuu/nge8ylTHXSsjYuwgwcJPwXW4mcdNCeiF6Jf2Ihmw/2OGZ6TpJd3ILYRatlTxd 0r1fV+mTQ9hoSa5vIYctaHm1TPR6+rQzWf1XVmgZqRL+DZcz11+Jnz6bfA4ui/XVSTlc 55YGtNHxUXNBpvvqVcSUbzk/8QXHdM4VX4p8WkrmIKtYAoD1K9BkG31UL9Vb/9QMXpw/ 7AGkEWMLv4UvoBQf3pDkLYcYyLPLji2VUGo1tfDbufHXZZSe0vXHL1EIWjhJmwsjCt9r eKtaB1Gzfo7RIWjfwx/Qh/eJOaf8WfLRkkKzdBg4y/exZGsxt5P2TWmIA0I2tgJgaAEm 781A== X-Gm-Message-State: AOJu0YyLfAcI/ISaFF7+LgJG+ET135FeqiH388qHYi0DV5OVNvlvN4Ed IM54DfNQ+eZXoxIm7VRII4BiYBu6u/xsBmTlb6Q= X-Google-Smtp-Source: AGHT+IGm2H81WmpesZ5E+X9dFENq8PLOco0PyI0EPFlo6tiYgSWahiWhYtob1ocEaHDtbsgTQM9NOed+gLkBJcy9+Ds= X-Received: by 2002:aa7:c998:0:b0:527:ab3f:4350 with SMTP id c24-20020aa7c998000000b00527ab3f4350mr9728352edt.38.1696704515369; Sat, 07 Oct 2023 11:48:35 -0700 (PDT) MIME-Version: 1.0 References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> In-Reply-To: From: Daniel Jacobowitz Date: Sat, 7 Oct 2023 14:48:24 -0400 Message-ID: Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000ed6f85060724cd1c" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66381 X-Mailman-Approved-At: Sat, 07 Oct 2023 15:20:09 -0400 Cc: 66381@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000ed6f85060724cd1c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I definitely got that last bit about buffer-stale-function, but I think my point still stands - the file isn't checked. On Sat, Oct 7, 2023, 2:41 PM Daniel Jacobowitz wrote: > Isn't it? > > In auto-revert-handler: > https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779 > > (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) > (/=3D 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. > > > On Sat, Oct 7, 2023 at 2:28=E2=80=AFPM Eli Zaretskii wrote= : > > > > > From: Daniel Jacobowitz > > > Date: Sat, 7 Oct 2023 14:14:45 -0400 > > > Cc: 66381@debbugs.gnu.org, Eli Zaretskii > > > > > > Coming back to my original suggestion: the documentation says that > polling is used even if > > > notifications are enabled. The implementation does not poll if there'= s > a notification registered. > > > > That last sentence is not true. > > > > -- > Thanks, > Daniel > --000000000000ed6f85060724cd1c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I definitely got that last bit about buffer-stale-functio= n, but I think my point still stands - the file isn't checked.
On Sat, O= ct 7, 2023, 2:41 PM Daniel Jacobowitz <daniel.jacobowitz@gmail.com> wrote:
Isn't it?

In auto-revert-handler:
https://git.savan= nah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if buffer-file-name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (or auto-revert-remot= e-files
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(not (file-remote-p buffer-file-name)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (n= ot auto-revert-notify-watch-descriptor)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0auto-revert-notify-modified-p)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if au= to-revert-tail-mode
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(and (file-readable-p buffer-file-name)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (/=3D auto-revert-tail-pos
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq size
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-attribute= -size
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-att= ributes buffer-file-name)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(funcall (or buffer-stale-function
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'buffer-stale--default-f= unction)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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.


On Sat, Oct 7, 2023 at 2:28=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wro= te:
>
> > From: Daniel Jacobowitz <daniel.jacobowitz@gmail.com<= /a>>
> > Date: Sat, 7 Oct 2023 14:14:45 -0400
> > Cc:
66381@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>= ;
> >
> > Coming back to my original suggestion: the documentation says tha= t polling is used even if
> > notifications are enabled. The implementation does not poll if th= ere's a notification registered.
>
> That last sentence is not true.



--
Thanks,
Daniel
--000000000000ed6f85060724cd1c-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 04:25:03 2023 Received: (at 66381) by debbugs.gnu.org; 8 Oct 2023 08:25:03 +0000 Received: from localhost ([127.0.0.1]:56211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpP5z-0001xw-4A for submit@debbugs.gnu.org; Sun, 08 Oct 2023 04:25:03 -0400 Received: from mout.gmx.net ([212.227.17.22]:43285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpP5w-0001xJ-CH for 66381@debbugs.gnu.org; Sun, 08 Oct 2023 04:25:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696753473; x=1697358273; i=michael.albinus@gmx.de; bh=ouVZscAsM5TyEsbnCGmnsW0vSsP7tTiYf4NI467OBvk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=QJnNYcIufBb0Li87mc0wrxFuQ6sikZdyigpmUG6wkS81bDzZdxEW+R8Xgy3Ehs90G9oct9OkY26 eBvKHTK3/k4Q7iY2es9c30eX3BczPI1DRC+fJMQBNZnXj1mBJjJNQUGrIFDmAvzHRg/BuZUgR+5C6 dsja9XpBEAtiAe0cuFSsvvQ4wWsW5hTHDtqPj/u4meZIvNlpnRhGwZjFoBpbi158VMHZi/qRCpawk B7q+sZQzFXzlmtSWt9QhGilo9e27YJ0KpfV0kg84gplYX5q7GfLmt9bsAkYY6xEhgu2/LRKSQ0eO/ WrtTWCbCrrZfRQelTWmj1521Mg0MxfHDv01A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTRQq-1r1P6j2RfY-00TmPI; Sun, 08 Oct 2023 10:24:33 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: <83edi6z294.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Oct 2023 22:00:39 +0300") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> Date: Sun, 08 Oct 2023 10:24:32 +0200 Message-ID: <87il7hfrnj.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:2nfL7BnHylld3GMjLOeYTRTAhQweJZaxr0zmwo2LmBQ6bd3KRPq Ab0QH3owtytn5OpTa1axz4aSelMqzF3LmoRNqqAF2aDISJeEHx5PFnuu07harZHixlwuJ5N TjzX2Cvjr2pcwo24uHBtZUx5MkiNsCwfYITR5jDLVapM5SZnl3f8szvTR5h6/LOwPDwJtj+ daSbw6wR3q7Nzcmqciwfg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:u8JHq5B7M0Y=;ayDS6C5gd4zQ502/1W1zgAJHHwu 9z30BRgD1tT7AZujqMuqNI8hEE8PVfR30RLlGe2TzlE0b6nXxRtnJjAkDBqa0vAo8nu5CkSRZ d9as1j0YrzzXq1pCxtVsmnhbLSJVRW1IWo21ABHvZylqtI7nZB2RQqYWZ7NVSFURRrOc4+jVz fLeWL0KHOz8B9j0UapyHYEha8qQRE9ahwrUA7FxoirHMMqqksBDA3xIcbD+pfm7bLX/zSfFb+ yCsZ4WlJsKkXRuV+WrogvMLZuQWcNxeLOzUcmJ2R6CMNIBCHAnLVp/X3ZSAZR2760G7oHHZoG 0IccsClXbJHEp/w4KoXJ4rzGSTxhw6pI+Bse7zuCFI8qPXaSZ5K10BCb576W/2TG6DCaGRFcl dGOJQT/XESNUsrIUEA8Hz+TdeirWTutt4S085rPu9v6YOY8Ycf/4Qg2CjjsM3BJa/biC+DX4C 4KWGNoJ33c4ZMleDFoF1g+1GEXaENWLHlEuvpZ44IwENCzoHn2SKnf/VyXGy3geaEJLWzlhUA h+wd4aikKRtlR0+KPdcD5FDHUvse59VS+vGLPHc7EPDa11D4RFUAaOK3T/yuxZl3jfqYUlHYW j1F/4HnuniFqBqqO4fVotCFN9Oyw2jSt0f0qe7pcDUIRYhcLoH1EuUVVAPZ0yELySP91NxTJw SCu6Ak5UtvOlNBg55EhiwVpQtJS4s4n1gYAQOhBEOjrUJffo7dRMJEi6Bhb3CS9ILzHZNX03w tOad3T/msIXE7RDCAwBImGsO9oCxASmIYK9ky5zIusnjlFHSgxQ3M0IzPxpIuFFfqobgBez0L 2pmK762Tb9bibP+rDIgaqxR2riqmihxCBpCLzM3Pn1zHw+nrmhIk1MrPkl3YCXxbiIIV+c3Tk 1YjVwJzMNhvnd58p4XpZnAWLIQQLLeJGVMjZfoYWc5CInEL3mWQMw7l8d45leNS8sY+zgCKZ1 MXGAKA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Daniel Jacobowitz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii 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) >> (/=3D auto-revert-tail-pos >> (setq size >> (file-attribute-size >> (file-attributes buffer-file-nam= e))))) >> (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. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 08:38:52 2023 Received: (at 66381) by debbugs.gnu.org; 8 Oct 2023 12:38:52 +0000 Received: from localhost ([127.0.0.1]:56486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpT3b-00043b-Qf for submit@debbugs.gnu.org; Sun, 08 Oct 2023 08:38:52 -0400 Received: from mout.gmx.net ([212.227.15.19]:43581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpT3Z-00043K-JB for 66381@debbugs.gnu.org; Sun, 08 Oct 2023 08:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696768703; x=1697373503; i=michael.albinus@gmx.de; bh=xJ6cTUS0ecoFOjb1yaQY2P/sXwdRjAA09sSkk4EOa80=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=o+bbgM7qrlZHwhOEZOHCJSz1iug/OFDILOhQ7xKbeoTTZqvfwj77E3vZ/2vJDaCNedbNsmyvuRk 9pzp+xGLqJ7q+Y7+uO7UXvuW/7pxrMEMMLQILLcMCMiYwM+F0cY4gwoisVHU2a2iYRRZ/Tjp9uVT4 NSwvNIIMB/SUSmeUh3hGvlwVBdW/+uuNLEqVodF5ZYUH2Q1tkhXBa0BsOgEWvJ/03vFsRv39ki4PL F6JZcZr62BdWvd9fyMPqS7EoILDJ32cMIg4QfUxmzssbnM+ZqkCoklw4V7Bw6XGFfBFi+22VAmgYx WPYrdKDfyaSq8edDT5rJvkeVKCfzZaJMr5QA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Md6Qr-1rOFdV40NH-00aELt; Sun, 08 Oct 2023 14:38:23 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: <87il7hfrnj.fsf@gmx.de> (Michael Albinus's message of "Sun, 08 Oct 2023 10:24:32 +0200") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> Date: Sun, 08 Oct 2023 14:38:22 +0200 Message-ID: <87cyxpffwh.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:rAZ3PaHfrqZeqBLyZTiUjWFqHGASNWHb9OloEQr8/Dh/S7pCih9 HPGbsfolEiihyAuJ9i+Oru6yXvkITRPPTh0QpxEEhSQjAfSVrw/CNMJNUPsk4Nd3/s1u9Ct AO4SB593DW0QAFcV06m14PIz2njtNa8s4L/KrNtSsPvJNplGLCRDEuLZJw+tuOwBiW/LdwK pelYVzkLaqh2i37HN0RUg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cDOcJxltkJM=;dR1VZxVst8gRUL3OhQ9Cjfw+Ovq hgXeS64PAoVsNcUEEz0k+Dt4ujTr5dCPFBjIVZ7V1TB3af0AoiPKbF7GX4W+m5vDlHLhBA9Ul n07tl6K0ntezCuHG2RksCSkmQRRe0vO48kKyiC6p9/zvwnc6pzoxejkGRAvzEGAJd2meAaB+l BIbvFvlyI4i/MV3H46G00hsOp5y3xsRCG/WiOI6SYWgiraeiQ29/3F4OCB9l6ZhpC8/X5pi/L Xput1uKL6BYDQub/jBjcqcVTc0mgFwqzzLNfhjoU1LMeVWgGpBooMIpm6pFHkg8f41odXn92/ bY6cLN42Hv31FV5Vn7OLaUzLMQG0GHEx2he1tr/5q/6HhZ4COHifKoGqk72VO5tT+n7/u2K0b 8O4ZyhIR8OkLgTLjzZtoCuZk70ydHYHGwpp47NVtFJrLsb5Vo6KpFCU9NpvzQ/eTWyHdok0It GgomynEx5ofmeMS/VeNmgJW95pkhvJryKVHGWjU3i4ZuSw5ks24IzHFybCtKVnDFe3JBdYBMk POtPX+lM8InxFR77wGRu0GnNy8os35pfWLvKOBoPX8VWyFNG0zbVszEAl5jVayU2mg22r+8/l J1t9isKrbVe/iGy0bIDS8jYgpsHjgkWT9LOj9P0sTh3LIIR2qXj8dw45jP8CAUHHe0EiFEqZp OH11SxJGxQhiZrX9hHPNtL1s+Ixs4F6opv1LoM788Dk5jXa9E3XrO/EciueGrz76gLwE6Jvhx 43KypNpZf8Dro5DXQ2Qu95N4lebC46/ox1N8fG4zi058OT/pq5Tnh3bfg0bT7LsyTux+O7L/6 YrzMdbCUZcJHDyYgAM5LevER63IMfXVscynKxr+v1rRaNmpmJuvcm1M9fKiPAwbjq/Yr1qZ7/ FVDZkjSvWbbB6NBQDOyMwIIv/k7y959N9J5JGCt3wXonPLmV7+vlq0MohuvO/NfjNeepmT/f/ 5F79Sg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Daniel Jacobowitz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Michael Albinus 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/filenotify.el b/lisp/filenotify.el index e9f8d4e515d..16a154723b8 100644 =2D-- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -138,7 +138,7 @@ file-notify--callback-inotify ((memq action '(delete delete-self move-self)) 'd= eleted) ((eq action 'moved-from) 'renamed-from) ((eq action 'moved-to) 'renamed-to) - ((eq action 'ignored) 'stopped))) + ((memq action '(ignored unmount)) 'stopped))) actions)) file file1-or-cookie)) @@ -202,7 +202,7 @@ file-notify-callback ((memq action '(delete delete-self move-self)) 'deleted) ((eq action 'moved-from) 'renamed-from) ((eq action 'moved-to) 'renamed-to) - ((eq action 'ignored) 'stopped))) + ((memq action '(ignored unmount)) 'stopped))) (if (consp actions) actions (list actions)))) file file1-or-cookie)) @@ -339,7 +339,7 @@ file-notify--add-watch-inotify "Add a watch for FILE in DIR with FLAGS, using inotify." (inotify-add-watch dir (append - '(dont-follow) + '(dont-follow ignored unmount) (and (memq 'change flags) '(create delete delete-self modify move-self m= ove)) (and (memq 'attribute-change flags) diff --git a/src/inotify.c b/src/inotify.c index 105ff5a9d8a..247d9f03055 100644 =2D-- a/src/inotify.c +++ b/src/inotify.c @@ -148,6 +148,11 @@ symbol_to_inotifymask (Lisp_Object symb) else if (EQ (symb, Qonlydir)) return IN_ONLYDIR; + else if (EQ (symb, Qignored)) + return IN_IGNORED; + else if (EQ (symb, Qunmount)) + return IN_UNMOUNT; + else if (EQ (symb, Qt) || EQ (symb, Qall_events)) return IN_ALL_EVENTS; else --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 09 17:36:56 2023 Received: (at 66381) by debbugs.gnu.org; 9 Oct 2023 21:36:56 +0000 Received: from localhost ([127.0.0.1]:33605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpxvr-0008KD-IT for submit@debbugs.gnu.org; Mon, 09 Oct 2023 17:36:56 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:42267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpupJ-0004GM-1y for 66381@debbugs.gnu.org; Mon, 09 Oct 2023 14:17:59 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-536071e79deso10578134a12.1 for <66381@debbugs.gnu.org>; Mon, 09 Oct 2023 11:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696875450; x=1697480250; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ALTU/8480TIuQ0gl4AhZW6JcNKoVPV/Dgvp8595ot+A=; b=BqmB/lW/5WS/xFfitPaXG8I5qATi95+fC2UsSTayDE/eCQhAF6W5VYaTRpR/sr78tY XSVRlSD4RkAWI5c/sbQxX0t6y4yum6kVjJs9e6KK4Z8H9SxzKWANUh/aKHHzeZeWdOdD sBUf4z8z7SmxDaultVb4lQbWEJrjQu9NthoPhB8hULtNsJcgkqQ2X2hztMZNZrnrcdTx nFtVLzIV14k7HO515i3OOxf6DHHwhEeZc0QTyaXQ/fjTj33TAhNI3dtvCRncKIAm3UOZ 9p2d3ajDckD58wfadcjS2t+C2I71PbQS9KfLX43ihNFM6S1M5KyJWkNAqOLrBIkVjEvC 8iKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696875450; x=1697480250; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ALTU/8480TIuQ0gl4AhZW6JcNKoVPV/Dgvp8595ot+A=; b=CZppf18TRyUwJ7c79P5DUGv8qfL8itXqgwr9iyCTPTktZ2/Kz2OYU86vvTVTJxqwFj luYf2VC4o5fWxK4brnd+ZbghDMXCM6Jspf9aMO1w9z+iKAyTuHlWbpircj1QoRuib0C3 kLkUDRCkd4Rw4bAyR2SCuc7dwB903yiJh5bI9gRlheP0BXkYxgZxBSsVLwjHkjFsgW8R 98E0RnGvvsg6XmcPzGXfg10TiIHYURfHxSgrq5F5hdaBvjHSjgwwvrnv4mcw3aqhjwjv yTFVMfLj5MOtbY/xGZq3JIwmrsg5kTHcsCiJ0ntYUtPrDb5DeSaQDsb3lCWmFTLqYf0V yRbQ== X-Gm-Message-State: AOJu0YwNuFZ5vp9jhTOpCayUlRIrkITq2TpZoN1YSB3sOtokN/0kva1A fHjDKvg6jxnvkxDpyiuL1c5x+TzDvK5VOmF7Qaw= X-Google-Smtp-Source: AGHT+IFXT3hlnau3LjQCE7tfZeK/OHBy/w8biJcTOLdGKGD5lixo2ZiSeQ8eIlv9U3JepTT7L91L6FSAntsOXAQxbko= X-Received: by 2002:aa7:dcc7:0:b0:522:b876:9ef5 with SMTP id w7-20020aa7dcc7000000b00522b8769ef5mr12422579edu.8.1696875450152; Mon, 09 Oct 2023 11:17:30 -0700 (PDT) MIME-Version: 1.0 References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> In-Reply-To: <87cyxpffwh.fsf@gmx.de> From: Daniel Jacobowitz Date: Mon, 9 Oct 2023 14:17:17 -0400 Message-ID: Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled To: Michael Albinus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66381 X-Mailman-Approved-At: Mon, 09 Oct 2023 17:36:54 -0400 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 noti= fied: 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=E2=80=AFAM Michael Albinus wrote: > > Michael Albinus 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. > --=20 Thanks, Daniel From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 10 14:04:22 2023 Received: (at 66381) by debbugs.gnu.org; 10 Oct 2023 18:04:22 +0000 Received: from localhost ([127.0.0.1]:36866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqH5h-0002j4-OI for submit@debbugs.gnu.org; Tue, 10 Oct 2023 14:04:22 -0400 Received: from mout.gmx.net ([212.227.15.15]:38811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqH5d-0002im-Vo for 66381@debbugs.gnu.org; Tue, 10 Oct 2023 14:04:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696961030; x=1697565830; i=michael.albinus@gmx.de; bh=Cnz1wY6GNo+YxSRglFfMZi70W28/VpFUh785NhEz1l4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=itXqSllFjSuYykExX3OoMKIBwmiz31Q1yJp/ZqvMeFcGAHsqUr40Ba1rEDcYxrf6Vu8k/x7HQw6 Mcye+g+bXbZxUMkxU9iSoQx5oIDdKR9lG0SmFqh2uajNHjIVmFqBj1Isd7HfYJ8NbyyQpvniIcqsj 2MUjHCP1bpjG2BjCZWj8yGvQQcimcg/HAdgVK3bIPp7sfuRvBkY5+5UbUDcztNBTuhjiksYFqN6MC 0dteqyqyJAwZg93pOMUeXQsU7MPRQiDK19D40i446rZhPpq650Gyah01w77y15dOmGOV1O5pzJ/Z1 ipWEZlIWNhgliarf2atLEu8xaKGDdjtI5TNg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQv8n-1rBVGU3zIV-00O22u; Tue, 10 Oct 2023 20:03:50 +0200 From: Michael Albinus To: Daniel Jacobowitz Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: (Daniel Jacobowitz's message of "Mon, 9 Oct 2023 14:17:17 -0400") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> Date: Tue, 10 Oct 2023 20:03:48 +0200 Message-ID: <87edi2cq2j.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:sitS7SFZ9WMAO96qHQqdGwGzZabkyms78v4znkQNJKFcV9+U7ud X2x76neRvabVCmvf1FRvN4aDUiYvljx0iRh2YV2+VCFzEt8Kb8+xzg+wsbcD2oGI0ciAQ3l l4N5gJn3GGtvviUl0JlB1snjxkNlEMaHqAnrJbUQVTFmkx4t0cmQS3HjpxUaXILEY6Ej43q QHJn5fYNOaQxF56k2z5fQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:io5O8O20F84=;Jx3aVjhnjW1zu8EZWBrkei9je8F 3RVIu2DKkyUCka7/nUsk3PtnUmlIEs/d83oSRdBqC1VFlZiK7EqZmeDY9yac3VQp+rUA0ylyo EWHSxLpwuj+RdgMZdNGEzP+GQ2hPmEzxZ3bm5+YGW41bF8O+O8fY2QQiRAoEkDG6EIQcvg20T 1T5YGXPQMxdKbxQvhQ7l30WkP7CzFDyHiMd/AYjrCDnGU8Rmvgqb0i9BEe/uWTVG543ckGSTm sZHOLiJ/PffcSi60oesgDCMzfez8enlkl0z2YaiUUbuMWHJ+QQMJSxGTbutIFFkc9+D/yizUK pTZUNxvcHlwB1XVnbF3wa5GJ7XgPhYdpI6dUkj7LzCVohGOk3UfJXrt3lz4KVa6X/fDF2X1hM TvhY013vgTjv5lA+VluSZEx6qPI3yuiRVTQui2YCpXBGuUBdZVneT1j+xAL/jVmM71ArxT2yv HRPO4kN65+FIs8DImY1yhEqsOk2GAqwpd+qPKwzIeFdQ4rrkdCN6pQ9SySBrNttnehOFAlkWm Ahy+/B+desdwBKopv4NdnfUhT4rhETb/LukxbiOuHbLVv6UW2iTVv+3sK5HGxRTnROrUIlxlD jrfAmi4hHzw7F7Z2O2SAjj1cDUkjYPUVTsW//lbDj+DP8hW2IzQWgn6QVmLQPPVAYnFkBTqtx o62h2e7+P+H9q3Wog4yR+1UC43XhviYVhYxvZMFHTF1xT8b4Cq00WTql9gu7NQ320n6dXw0Cr 9u6IglpYH04G+qqNMQfNDphFlfQMt3leNfsAPvDXtClhO5OfeCMlhJCq+1c/HOAeOTpHQgDoz TAUv4HIo5qAF3pZQBPooHSiqTSr0njH+R4gj8LfHh0bA0rSQotsUlMKytRlEmB5LJVppW3vfg WMQopdo5QCg9KknqAYNQrE3FmiVyY05wC/hR7NFjUu4To94Zj/91WFkJTcsbDRievT+NPw6ZS 7AGW3A== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Daniel Jacobowitz writes: Hi Daniel, > 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`. Noted. > 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! Thanks for the feedback. I've checked the other file notification backends, and it turns out, that none of them reports unmount events. So I have extended the patch, the unmount event is propagated now in all backends (under different event names), and it causes to stop the respective file notification watch. This works for all but the w32notify backend. I dont know whether this library supports a kind of unmount events, and even in case it does, I wouldn't be able to implement this. Eli, do we want to do something here? Everything is pushed to the master branch. Perhaps we could also add a test case to filenotify-tests.el, but I have no idea how to emulate unmounting in a test environment. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 08:06:00 2023 Received: (at 66381) by debbugs.gnu.org; 13 Oct 2023 12:06:00 +0000 Received: from localhost ([127.0.0.1]:45383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrGvY-0002dH-0O for submit@debbugs.gnu.org; Fri, 13 Oct 2023 08:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrGvT-0002d1-TM for 66381@debbugs.gnu.org; Fri, 13 Oct 2023 08:05:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrGuz-0008V6-LJ; Fri, 13 Oct 2023 08:05:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FoaS3fca8SP5wgg8xwrY3qgaf56/bdI5EtEiUW2Y140=; b=sHAV6udZ5k7v gyZF1tPJ98Pd/ZCDzwnPEkiSrmK8h/L9FX+Nb/dIrk/GEeqpXlVKCTYi8LYwI3tJpK0L+Antn8ZqB 7AoA4wQxxlfDM5ztBAWB6ljAd2CZHrDTT1SonQeBDhE1m6oO3iPVN9Yrl4dPHwRNDd98nOT4Sxo+E +rCSTkeHt+Pn9muaH6a3g1L4UdzbGoytcGBpWqZoXHTb7zVBuF9kIRw1ayylq+Oz3N/6JsK9CH4SG U/hRvZXv5wj57CrR5scBJZGhPflJlu4YhzrnABSi7xfj5rlvACNK1M5XazaccgSOFVD1JyOB00bnu WLPsNrFL3w/b3bSB6zikdw==; Date: Fri, 13 Oct 2023 15:05:21 +0300 Message-Id: <83a5smu3r2.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87edi2cq2j.fsf@gmx.de> (message from Michael Albinus on Tue, 10 Oct 2023 20:03:48 +0200) Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> <87edi2cq2j.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, daniel.jacobowitz@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Eli Zaretskii , 66381@debbugs.gnu.org > Date: Tue, 10 Oct 2023 20:03:48 +0200 > > I've checked the other file notification backends, and it turns out, > that none of them reports unmount events. So I have extended the patch, > the unmount event is propagated now in all backends (under different > event names), and it causes to stop the respective file notification > watch. > > This works for all but the w32notify backend. I dont know whether this > library supports a kind of unmount events, and even in case it does, I > wouldn't be able to implement this. Eli, do we want to do something > here? I don't know, I will have to test this. Could you please help me by showing some Lisp I could use to see if unmounting a volume gets reported in some way to the file-notifications machinery? I have very little free time these days, for more than one good reason, but would like not to postpone investigating this for too long, which will happen if I need to find the recipe myself. TIA. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 09:59:34 2023 Received: (at 66381) by debbugs.gnu.org; 15 Oct 2023 13:59:34 +0000 Received: from localhost ([127.0.0.1]:53857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs1eX-00023g-Lu for submit@debbugs.gnu.org; Sun, 15 Oct 2023 09:59:34 -0400 Received: from mout.gmx.net ([212.227.17.22]:34871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs1eT-00023P-EU for 66381@debbugs.gnu.org; Sun, 15 Oct 2023 09:59:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1697378337; x=1697983137; i=michael.albinus@gmx.de; bh=AQcQXAHb92EcwvHC2kVnCI4la4PYaeGToTZAOc1ymJs=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Ti4eiivknv08NA3czS0JkxiMuBSxN/JT5c3AAifOMGgicEPeQMrt1ET05uonridC4qDXDs+NIS7 nrcfd/uPBBBqTW3pzGkAC2VoVfRQcZdIF/PbKHyGjV0vhlMEwbJY0m7EzblIZ1AgeeaItTx0ZkwnR urh1hG9jQVhEcLWZ9T+SIFKuy9zV0iDenyzgswHe0Jh7xyWOzOZLGHfBJm2hlw7oSPe7wwcKf8LjK 76AhPu6RA6BupXCRYipXvMdiU0AKqR4HV51pMkPIpL8Kah5SU++s2Yu0zq27yriUo5hl9qe16i4On T1/4snTj1S78ARcbZeyuhj0phA051+kJeMhA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTABT-1qyoU20lVn-00UX7c; Sun, 15 Oct 2023 15:58:57 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: <83a5smu3r2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Oct 2023 15:05:21 +0300") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> <87edi2cq2j.fsf@gmx.de> <83a5smu3r2.fsf@gnu.org> Date: Sun, 15 Oct 2023 15:58:56 +0200 Message-ID: <87edhwm1gf.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:FqFnZ5K4H295N8IC/m8qnIQi7cx3sh9g6V6yYeL/fEzPwj2/Noy 4FxWJK9yN/Yu6y+U3TN2/FjiobtdJabC9RYp1Cide1Xr9Bcjm/xNMOR1vzhm2gxMk1cB1qG 8cyg6AmiB6qk72OU5YMHgrtyeJk0hZU1LXuMmedUK+a0nubEV5POC9HWHbJ/g81wonjwk1k XmfEii3jD8TUWLMZI5/7g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ku34NP34R8g=;HrCV+ES+MiYb+o8YI3oP061B0FA AJk+5U88lPfE1jxLNT/E+RRiXK/cJSN3ori5kHZtijr9TGFG18SUtXIS7vjKBx2o8Xoy0gINV ApzoL2UQ5vLbasDPWJ0vPjxkdfzDFb7G95+NZTCYs7Z0nM5ig1sfuY8rBvhrfVEzzDBCz/lUy Dj8AAVuPJmF+GCMMioJsHh+5L8Yyt8kB1zRpZhAL7JlHnB4LQapHVUOJQSmPXBG1915+zAH26 vMbXBQ+jmOLh8Woz/fS7ZWHjMSh1bbTU+g0oCU0e2Qowr9F2/Q+PZYWBMPcI0SWehtuVp6bq0 wWtd5zTlBFcCy4E3sUCfXqf+OujFRxgncfAxZ/UHb2Ga2Sruid7bZUrRkC90oSqIvw7LgB2VO sBsEQpNc1XNYNmzH4gaSignVtu4Vy7a4F2e1+/WDpH9z3lA1mEgqG3ijfwBcbnGozhpNyd236 cwUCxNg/zNMJdNP0qxdO9gCz3FHNBNZcwzqRtUo+BVH6GRhvrGnsydearDNI3vkbBLobMiSWP KlNoE8Ml9F8Qc7P7tBbrxPpeAo+6vifQvR7Ip/bOvrOP2RUWxf3JCG+rQO2uB8r8Ma4FNTD4p bRG1GP6WPGdHRurnZ/9ufwtZv+nKTk/TDWh5204qd7bsYIJBQpydD8SoV/RiIxhXEKuwJpVSQ 4jqG6hr4MQNn3d/BZYhSN3T7CFpnsSbB7avaWdZ29M/DjKM3ebUxBXMzL9jvEvvmcluNgNxVZ JDAB9SNZRLvJ5aem0DC5TUwq/fP18pAcbczph30UuFqfug/WeAWVfCORPm8RDOetZE2lOjf/C TvNALTJKUKZ8S3dF1l4Eq6IAYr0gGH6RSU5FK41IQZEhe1dOj5jLNqIRLBxSLt980dK2RdEwf 5kX4EAp1mSsb6xx2BoS6unKP/M99TMDg7B6rgLfPR3TsHp8N1nispzXVKm2NSoDebVgstqY5l NzTm869Ylx6NUhFvAYHm2PsLAjvqkJclJJVaS4QVDqdsR7IV X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: Hi Eli, >> I've checked the other file notification backends, and it turns out, >> that none of them reports unmount events. So I have extended the patch, >> the unmount event is propagated now in all backend [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.30 listed in zen.spamhaus.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.17.22 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, daniel.jacobowitz@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: Hi Eli, >> I've checked the other file notification backends, and it turns out, >> that none of them reports unmount events. So I have extended the patch, >> the unmount event is propagated now in all backend [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.30 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.17.22 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Eli Zaretskii writes: Hi Eli, >> I've checked the other file notification backends, and it turns out, >> that none of them reports unmount events. So I have extended the patch, >> the unmount event is propagated now in all backends (under different >> event names), and it causes to stop the respective file notification >> watch. >> >> This works for all but the w32notify backend. I dont know whether this >> library supports a kind of unmount events, and even in case it does, I >> wouldn't be able to implement this. Eli, do we want to do something >> here? > > I don't know, I will have to test this. > > Could you please help me by showing some Lisp I could use to see if > unmounting a volume gets reported in some way to the > file-notifications machinery? I have very little free time these > days, for more than one good reason, but would like not to postpone > investigating this for too long, which will happen if I need to find > the recipe myself. TIA. I would apply the following recipe: - Use a mounted share. In my environment, "z:" is a Samba mount. - Call --8<---------------cut here---------------start------------->8--- $ emacs -l filenotify --eval '(setq file-notify-debug t)' --eval '(file-notify-add-watch "z:/123" (quote (change attribute-change)) (quote ignore))' --8<---------------cut here---------------end--------------->8--- - In another shell outside Emacs, call --8<---------------cut here---------------start------------->8--- $ touch z:/123 --8<---------------cut here---------------end--------------->8--- - You'll see in Emacs the messages --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify (541405157192 modified "123") file-notify--callback-w32notify) file-notify-callback 541405157192 changed "z:/123" nil #s(file-notify--watch "z:/" "123" ignore) "z:/123" "z:/" --8<---------------cut here---------------end--------------->8--- - Unmount the share. There shall be another file notification, but there isn't. In a similar scenario I use with Emacs/inotify, I see the meesages --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify ((1 . 0) (attrib) "123" 0) file-notify--callback-inotify) file-notify-callback (1 . 0) attribute-changed "/tmp/tramp.sshfs.detlef/home/albinus/123" nil #s(file-notify--watch "/tmp/tramp.sshfs.detlef/home/albinus" "123" ignore) "/tmp/tramp.sshfs.detlef/home/albinus/123" "/tmp/tramp.sshfs.detlef/home/albinus" file-notify-handle-event (file-notify ((1 . 0) (unmount isdir) "/tmp/tramp.sshfs.detlef/home/albinus" 0) file-notify--callback-inotify) file-notify-handle-event (file-notify ((1 . 0) stopped "/tmp/tramp.sshfs.detlef/home/albinus/123") ignore) file-notify-handle-event (file-notify ((1 . 0) (ignored) "/tmp/tramp.sshfs.detlef/home/albinus" 0) file-notify--callback-inotify) --8<---------------cut here---------------end--------------->8--- "/tmp/tramp.sshfs.detlef" is the mount point in that case. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 08:39:14 2023 Received: (at 66381) by debbugs.gnu.org; 16 Oct 2023 12:39:14 +0000 Received: from localhost ([127.0.0.1]:55445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMsM-0008CB-Ey for submit@debbugs.gnu.org; Mon, 16 Oct 2023 08:39:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMsK-0008Bv-5W for 66381@debbugs.gnu.org; Mon, 16 Oct 2023 08:39:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsMrp-0005zr-FZ; Mon, 16 Oct 2023 08:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AJx+rsezZDtsNiqsUoA2C6f7SRI2YIjBip8ZNGs/zko=; b=c/5yZouciQrT /kk8GM4pC+LECUoTD61ttTeD923RWZHMUuQdEDF17qB+dm7Mv2gr6dJPs3fYyeNiL7XEaVxnAKvZH 16uOdo0zrYKxg8nGeArcLS5hp9Oh5auIQdMfEvpnQeVVRyzIjzXCPTz639DmTvXleIxe9xrFhUH+s L248KKr1cR3uzsKAg3vc6NAgBIdy5F5tYaRjhaNwkaiM6SbAPHmQ29Uk1ImW7Ju/UMhRrBTEsScwk CxKG4zFHn36H0sD8PClu1E+JY873D02x1wUG12gjFDLGlg34/Fmuw8TTE0BaVqGrsPXjgUeNOeH8R Jl6NucroxPOE5j+3lx0/jw==; Date: Mon, 16 Oct 2023 15:38:26 +0300 Message-Id: <83v8b6oi7x.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87edhwm1gf.fsf@gmx.de> (message from Michael Albinus on Sun, 15 Oct 2023 15:58:56 +0200) Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> <87edi2cq2j.fsf@gmx.de> <83a5smu3r2.fsf@gnu.org> <87edhwm1gf.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66381 Cc: 66381@debbugs.gnu.org, daniel.jacobowitz@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: daniel.jacobowitz@gmail.com, 66381@debbugs.gnu.org > Date: Sun, 15 Oct 2023 15:58:56 +0200 > > - Use a mounted share. In my environment, "z:" is a Samba mount. > > - Call > > --8<---------------cut here---------------start------------->8--- > $ emacs -l filenotify --eval '(setq file-notify-debug t)' --eval '(file-notify-add-watch "z:/123" (quote (change attribute-change)) (quote ignore))' > --8<---------------cut here---------------end--------------->8--- > > - In another shell outside Emacs, call > > --8<---------------cut here---------------start------------->8--- > $ touch z:/123 > --8<---------------cut here---------------end--------------->8--- > > - You'll see in Emacs the messages > > --8<---------------cut here---------------start------------->8--- > file-notify-handle-event (file-notify (541405157192 modified "123") file-notify--callback-w32notify) > file-notify-callback 541405157192 changed "z:/123" nil #s(file-notify--watch "z:/" "123" ignore) "z:/123" "z:/" > --8<---------------cut here---------------end--------------->8--- > > - Unmount the share. There shall be another file notification, but there > isn't. On Windows, I cannot safely unmount the volume: Windows tells me that it cannot be safely unmounted (because watching a filer on it has a handle open on the volume). If I unmount the volume forcibly, I see what you expected me to see: nothing. I guess this means the "cannot safely unmount" message will have to do on MS-Windows. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 10:30:28 2023 Received: (at 66381-done) by debbugs.gnu.org; 16 Oct 2023 14:30:28 +0000 Received: from localhost ([127.0.0.1]:57483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsOc0-0003oj-CA for submit@debbugs.gnu.org; Mon, 16 Oct 2023 10:30:28 -0400 Received: from mout.gmx.net ([212.227.17.21]:56173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsObw-0003oO-9c for 66381-done@debbugs.gnu.org; Mon, 16 Oct 2023 10:30:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1697466593; x=1698071393; i=michael.albinus@gmx.de; bh=f+Uh7/IRQid2ehk1J8ElEps6BnLhB1d+VrlnB+oPiB0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=BQ79y4rbaC/vmFN0wV3j0pbJni6JrzOIhLGWnUkCj8zuxMcpxz1Lx5t8VOixzud2T/L7F1SNlke rNPB27TuAntqB5QIJkM9MmBSz5FwbotfKALHg5QtualsDVKSdz4dOJPKfiksxZU1KO2pszx2O+sRA 0DkhO+ZXSn8yBpPI4kZ3fAvtutM5+jyIqghsLHrQc2WJz9N2SicRz7d/hlCZOFNAZ1kFn/k6MrCF9 zk9WYsWbBGOEapVwkbnyn78nRGeWIbTpTcIjCD4RYKqXzAjPkOaGbNBNTTPjhiel+731FCj1asRXy SLwipNG8MFWR1B+7XkasYcydmj3HfWXIAz5g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6ll8-1qu3pu3mEI-008LaI; Mon, 16 Oct 2023 16:29:52 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled In-Reply-To: <83v8b6oi7x.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Oct 2023 15:38:26 +0300") References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> <87cyxpffwh.fsf@gmx.de> <87edi2cq2j.fsf@gmx.de> <83a5smu3r2.fsf@gnu.org> <87edhwm1gf.fsf@gmx.de> <83v8b6oi7x.fsf@gnu.org> Date: Mon, 16 Oct 2023 16:29:51 +0200 Message-ID: <87y1g2prmo.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Gl991DII0EYdyrSVrtBVfPvgtjcjjbbeLh4ceoSqq9usnImJtpc TcRnoo4IU7h/bUmZM6CCDhEygFJr+Rtjn9h6+ACWfVHbtXhvYgzyvXnDitMQOCnC88on8pL zegZ0SfjS7Q40nDmaZvg0fdDrHFnGwoNBPfF5Vc5rfdTWo03hSerg7negl9hMJUzlqPOwjJ Cmt5ByoW7P5PKv/3Jgq2g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8uZnKN+ftA8=;Wxn4fsx4HRkranXAJAu/QW5G7rC myU1BRFxzF8auuNhAtWafeXawv1f7AjpOwmrgxyD6JSIfpF1rZyFiZo5Fs82TblSlX27V5hhi nNomJzpYDtxcLJ6U+rBgU3aAoeNS5VlCVv7AkscjH9llfAdbFu+1sHUm/bzMFVxLQt+GNooTD 42+BSCKMq2PAdmwaLe5vacAWGRu6kToO4uzn33631GITAZllDLMih8y5n9nGSejVk+OV+UCmC anerP5PQY/UHF1tCMChCRCAlBnOnjAYO/X+nxikWDiGxzCtkqugGCP3wfg5wTRbVpcIWAj60d dprpROx3PUyZQp8SJaxfSoXMMxCMfGjVnQr+e6sojMygLkJ+E7ha48xl3dK5Iiguz3U0Cti5e PaqxQXEJfpRQlskUD6B4Rlzutj+k2L295j84xn/tGzLxBKno6miUVQx6GYOD2iJwrmNMyUhav XTh5GYfZHYeJnzEfoBbaUxxU9mgMfyENmrD+Tk9pRiPhDDx0jBZOJKArsrSnRQAgmalWDc74i iXbG4nKEAjoVellCU7vHdKVZkVI54O08II4rlvSnP2+AtiDPfDFf1PJ357pEnrvYWtGLF/8i6 0xh0xfXZlVvUmC4loG26BHNCnjtWs/KnmN3m55IUYq36JDJUod4sbFJwMpigvql/4YbqZ6dVr CWsmpFAExxPpuqKCj/YRktUiJvnMK4N0ajDjqpHS7TWBVWGryVnK00jVcybYc70xYIMEaqCIc JAmy+f9Yupw3UXfGgH6PVAdukYf0ssocIN0pxvJdZeYl1Qu8z4ErHL2BlYS8A4GfiFlBx2q3R YtSSdz5PSOkqy5qCs1Q9bqRP43Gy4jDJRSs8UVctVQxU+dL8oSB5k7s/CdjVforMgxPwkgn8P J3Pag9BgZ56by7gGz6mHt3rUEFM+GVCofnvP/iTifQ2A1qhOF5mudZU4ZbaJJxl3U2AQtpgFq COddP0TBoLOOI6aKgSGiwcU21nHsUadZjZxiQRx2lnUn3/fx X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Version: 30.1 Eli Zaretskii writes: Hi Eli, Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.30 listed in zen.spamhaus.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [212.227.17.21 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.21 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 66381-done Cc: 66381-done@debbugs.gnu.org, daniel.jacobowitz@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Version: 30.1 Eli Zaretskii writes: Hi Eli, Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.30 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.21 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [212.227.17.21 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Version: 30.1 Eli Zaretskii writes: Hi Eli, > On Windows, I cannot safely unmount the volume: Windows tells me that > it cannot be safely unmounted (because watching a filer on it has a > handle open on the volume). If I unmount the volume forcibly, I see > what you expected me to see: nothing. > > I guess this means the "cannot safely unmount" message will have to do > on MS-Windows. Yes, might be OK. For inotify I have a similar issue with NFS mounts. That's why I've used an FUSE mount in my example. Nothing left to do, so I'm closing the bug. Best regards, Michael. From unknown Mon Aug 18 11:32:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Nov 2023 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator