From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#56342: TRAMP (sh) issues way too many commands, thus being very slow over high-ping networks Date: Sun, 03 Jul 2022 14:16:24 +0200 Message-ID: <87v8sefl2f.fsf@gmx.de> References: <8735fjh5ge.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39017"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56342@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 03 14:17:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7yXX-0009uX-Ug for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 14:17:27 +0200 Original-Received: from localhost ([::1]:50170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7yXW-0001lY-Oj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 08:17:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7yX8-0001kX-JR for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 08:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7yX8-00031a-AP for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 08:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7yX8-00037x-6W for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 08:17: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: Sun, 03 Jul 2022 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56342 X-GNU-PR-Package: emacs Original-Received: via spool by 56342-submit@debbugs.gnu.org id=B56342.165685059610771 (code B ref 56342); Sun, 03 Jul 2022 12:17:02 +0000 Original-Received: (at 56342) by debbugs.gnu.org; 3 Jul 2022 12:16:36 +0000 Original-Received: from localhost ([127.0.0.1]:43487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7yWh-0002nI-To for submit@debbugs.gnu.org; Sun, 03 Jul 2022 08:16:36 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:49201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7yWe-0002gE-Rw for 56342@debbugs.gnu.org; Sun, 03 Jul 2022 08:16:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656850586; bh=Bq8goL2n1LU3p25fZjzxCenjliNxFIJnopPzgnaFLa8=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=IbSOV6fBaXy9MwUhayzqavELHxVoTUFWjS65D14Mt3pmFCgFnO9i3rNxH40kCmAyr N19wAc6ceEXYOkG5N+AuQzGQUOL3VgcFtxI8/TkXgLRL8pgAaogVyeYPwxBDXHrnj1 yYmpR/vZY01h/7ZK0DzJzyyrnbu9aJFvXlctMEtg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.148.177]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mk0Ne-1njfGb3mnY-00kPpU; Sun, 03 Jul 2022 14:16:26 +0200 In-Reply-To: (Paul Pogonyshev's message of "Sat, 2 Jul 2022 20:14:35 +0200") X-Provags-ID: V03:K1:fA846orykYZJmc49cCPmkSQuNSGii/X/NhHmuSWc1Ww8X/qRXPT LL1o1avDHZ0vLoT7y5istjnWj91Cy6C8yDqXX1qaParzH7pT+iu1EX3JOp0hvHsWLbf7nK8 Dwyj8eYLiCSnvQ51KkCHSB2dYUz5D9ky9JZR4Q2d10CoHt5QT7L4SInBC6juLF/981uAuJs VpH8GUm9jvqHPzljwoozg== X-UI-Out-Filterresults: notjunk:1;V03:K0:ovNbRz7LHho=:ALNJHY0u8kzTLOoEr9GL3y qepwazmOimzJMrTuOo7UhpK8DHMkoUCOBabDOUjCkLQx9uFDZBQi5zKhAYumKZS6y3K+FPN06 bCj+5Ulyf7+qns16KEpExki4MP+iE4KfcP/RJ+8fYpu0QZjVNHQ+AGWX9UxBxZuqdKG487APg KvQZ4kNu4U5TZxNG74I99iAy2R3gUARVLFheohj9uTpmayRvDq4T1Pa0DdIIcZQQvRkKIGzpg 7mR0wbNDDF2+OHL4qjAuWLdA2Ltvgy6xxaNPd2VXGAXTDDqyTl4vtI3imoiFrnQHck8XPENPW OCBHGDSXNqMmTYql+9xl2pyEnjFi2LNJrvM7UMMxQSrN7Y3I0YUs6fOC6jGmfUj3QkPfFO5ji viW2t2EgpPrCvQdc4c8c/TdcImxxR9kJxB1Twd0dS7tY/17BhZoTybce6zH88sE5x38bWH+Na vkVgD6ZB+eM9Oa3JxmBkwQk+FGrD+kYrbdEVkf5IfJ+tf0P/5vqtc+AitYlB6puALye+O9Kvi 8WfqnEPxoEmR8FeRSckDKlvtnoP6qv2D+V2aiP/NcFncWcroh8b5CvlURx8s7SPVwz5tSXgq6 AkBOUdtA7Wv6Ui8DoKVfPfgf686m90rHdWDs5QFQJksZtA1d2TY9thCMB1QjS/w5QDCpEY3rM hob6xqadZiANZEJ+YB3gFhegkja+FoXUZufhiMNSP51r+KF9YWziUYhsZiG8b+kSEQoTP20Yd dHVR0+9csLH5BOnZDNpyEBMVkEbbHQLm3tP79fyXvL9Ewtx2CQ/plG5FVmSfE6RQ8oJpeSlk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235984 Archived-At: Paul Pogonyshev writes: Hi Paul, > Some more thoughts. Why does it even need `echo are you awake'? It's a > network connection, it can still fail even if it worked fine 1 ms > before when you checked. So, why not just let the first command fail > if the connection is dead and restart the connection if it fails in > such a way as to suspect that it is dead (i.e. no output)? Maybe limit > this to read commands. This is a sanity check. It avoids to hang in a blocked connection, because this special command is surrounded by a timeout of 10 sec. Other commands w/o this protection could hang forever. See also the comment in tramp-maybe-open-connection. > A way to let higher-level code avoid certain `file-exists-p' calls: > add a dynamic variable that tells TRAMP to skip certain commands if > the result is not available from a cache. Something similar to > `process-file-side-effects'. Calling code could then do sth. like > this: > > (when (let ((tramp-may-skip-if-not-cached `((file-exists-p unknown > ,file)))) > (file-exists-p file)) ; TRAMP will return t or nil if it > knows or 'unknown if not cached; for local files there is no effect > ...) > > Suggested semantics: list of (FUNCTION INSTANT-RESULT-IF-NOT-CACHED > ARGUMENT...). Any element of the list with unknown function name etc. > would be simply ignored. > > Code that doesn't let-bind this variable will behave as before. Code > that cares can be optimized. If a caller can live w/o a valid result of file-exists-p, it shouldn't call it. Everything else is too sophisticated and good for trouble, I believe. In general, packages shall not care what's the implementation of a given function like file-exists-p. If they care, they could still use file-remote-p in order to distinguish. > Paul Best regards, Michael.