From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification Date: Sat, 04 May 2019 21:43:28 +0200 Message-ID: <87tveagg4f.fsf@gmx.de> References: <74CB5185-5DA1-4786-BD9C-9EEB3D43B3C1@acm.org> <83o94uz9h2.fsf@gnu.org> <875zqzssql.fsf@gmx.de> <83d0l7v193.fsf@gnu.org> <86EFE367-90FF-4786-BC91-FC28FAF38A4E@acm.org> <877ebdqmbj.fsf@gmx.de> <834l6gu6ee.fsf@gnu.org> <834l6eqdam.fsf@gnu.org> <8bbbdc62bee1dc16b6fd684e7da5ffac43f1e232.camel@acm.org> <87woj9nj77.fsf@gmx.de> <83r29fmz3f.fsf@gnu.org> <6b722334f6eaddcbbf3def636b5181c9439a172c.camel@acm.org> <831s1emvz7.fsf@gnu.org> <26e8159ac86da37d9cf555f6cb3f2dcb63ac0a67.camel@acm.org> <87y33mgo0c.fsf@gmx.de> <05128E42-E970-4C41-9DF9-E9E0BC1C9E4A@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="231604"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35418@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 04 21:44:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hN0Zv-000y8w-DA for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 21:44:11 +0200 Original-Received: from localhost ([127.0.0.1]:60363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN0Zu-0001m0-F4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 15:44:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN0Zn-0001lt-Qx for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 15:44:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hN0Zm-00042m-Rb for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 15:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hN0Zm-00042L-O3 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 15:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hN0Zm-0000ml-BH for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 15:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 May 2019 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35418-submit@debbugs.gnu.org id=B35418.15569990232976 (code B ref 35418); Sat, 04 May 2019 19:44:02 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 4 May 2019 19:43:43 +0000 Original-Received: from localhost ([127.0.0.1]:52352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN0ZT-0000lw-By for submit@debbugs.gnu.org; Sat, 04 May 2019 15:43:43 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:52245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN0ZR-0000lf-ES for 35418@debbugs.gnu.org; Sat, 04 May 2019 15:43:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556999011; bh=vNYwCvRRxshfgrqyfUhNfX77MmWo0hT65LuOE4So8eE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ANKbUsCtkHhIiWH+2cusXmB4lIBQyElq9ZPqKtJne2y6/goHn651KxYOHaq16YT+c +c4BLJNohqk+bsfJc9UffJa0P9cQjNCTNGy8SbO/7qdrsi8NJMVHhfx/WlrYEywf85 GHP63Sui7IpZ82xLzqRmGE3xr4YXNJqCBMUgQCkE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.86.57.229]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhD2Y-1gsddJ2CpO-00eNRe; Sat, 04 May 2019 21:43:31 +0200 In-Reply-To: <05128E42-E970-4C41-9DF9-E9E0BC1C9E4A@acm.org> ("Mattias \=\?utf-8\?Q\?Engdeg\=C3\=A5rd\=22's\?\= message of "Sat, 4 May 2019 20:50:18 +0200") X-Provags-ID: V03:K1:IzQPE3bcRVz+iEI7HtMtR5q8jTjwZZhQqa90DhldPGy5RiocOT8 MXmUYtAUE2TSlICQ8wejACnZVeQeU/cF+PjfKIWiUT9FR7SJP6wrr9HDn5A5iDcjOg4RIJZ +hnmy0PCAV3HFsmupCwjB245p8w4w5H/FF5GmK5KnHS/6woEg/hQO1nzsB3yJI6Br6Rxvih YOcHb3nyZ6zZPmMMxfCUg== X-UI-Out-Filterresults: notjunk:1;V03:K0:FDtQPjx0s2A=:XYRLtJnbUrmC64aWN60FoE wVjD1f0AojXLN0gwZq4vs6wl690qTc/CAxpOOWu2Qw0YqBXzCpO7J8I/h6Y9DXqkg8h8mz/0L 5Q/brOoJTMnvBDK4VbOHNXCqWCdci5/xh2leTWRw3DGFmpP2YNoH6nCCg+iKwrxr98Y/fn78H aFeMtnt3wQiQejxRvuQiDto/x6ujSd6Qgh0hzrqpq2W4lzddZp/ti1uac97xBltVEaM92kXDi KKJrv+qLzrePdKwMFU/2Itwlr9iyZl9kzQFVwLKNk82klvjrqG+ZwqbzQF4MCX+Vf8P+aPJnq v0bfKBYDcD8gEk/VXSCMlKSs/8DHzoCeReFIR6scrAsVVENSW1b9VtNHjVgzl5GgaTBa4iY4O beoGWKnikcu35z2oxfoO1IsksGYm7Cc1cuNV3YkFhavK7tqPk3p+N8JOfKhJ6Kkk0p7On5SIr Uf+xgylImjl3n2//DZJPkM6OeNzjfuOc86cFG4Wxd1wnSaR3FtyEVDSk/8iSuriO3+qonZL0v yyyql9uD9OJCq8oakleEECOdbI2TIpWrUOV+N1VMZTP0I0lRAW9enZD2oVHcCPVZEcU60r+nX M63KajOdVlngJmvwzbSfAf5zwiY1UE5VgSJJDEt66tyjHmNeRyvaznEIWgNiG1gwHjCrs/Gyk NlubQLp+tp1LEvblzHDZhg3uTjovD9rX2V+KOVRXgi6SmgORz/EuUVC4wsg+Sp6zX1xRTPimd S4FxDQh0llZUSh1PDlP6+xx5PBnt2457UZ7Wz/Owye2W7mi9rO71UHRU/LfepOIToJgoaQH+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158759 Archived-At: Mattias Engdeg=C3=A5rd writes: Hi Mattias, >> Maybe we could also add the other major reason why polling is necessary: >> file notification is not supported for all types of remote file systems >> (Tramp). > > Is the problem that notification over Tramp may fail to activate or > suddenly fail functioning, in both cases without any indication of > error to file-notify? Yes we have both cases. But file-notify is told about. The first case is that file notification cannot be activated. Several Tramp methods do not support this, and they return nil for the respective file-notify-add-watch call, as specified. auto-revert understands this, and knows that the respective file must be handled by polling. The second case is, that file notification for a remote file ceases to work. Since Tramp implements file notification as asynchronous processes, this could happen if the respective process is killed on the remote side, or if the connection between the local Emacs and the remote host is broken temporarily. The respective process shall own a sentinel, which sends a "stopped" event in this case. I've just checked the code; this is not implemented. Will do. > If so, we should take care of this in code instead. Assuming the > above, I suggest that file-notify consider all notification from file > name handlers to be unreliable, and provide an interface to > auto-revert, which will then keep polling those files. We have this interface already. For file-notify-add-watch it works already as expected. For broken notifications, the interface is the "stopped" event, which must (will be) implemented in Tramp. Btw, I believe all this file notification vs polling behavior is not covered yet in autorevert-tests.el. Would you like to add respective test cases for local and remote files? Some days ago I've added tests for remote files; you could use this mechanism as well. Best regards, Michael.