From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#70901: 30.0.50; Tramp doesn't use ControlMaster even with (setq tramp-use-connection-share nil) Date: Wed, 15 May 2024 17:45:02 +0300 Message-ID: References: <5959e6f4-607d-4a8f-8e49-fbdd9b438af1@gutov.dev> <87o79ags7m.fsf@gmx.de> <44185444-8a6a-4924-88f9-853f65a1c61a@gutov.dev> <87r0e4g428.fsf@gmx.de> <19d0563d-2778-4e27-92b0-03a86c8e1473@gutov.dev> <87y18bebf0.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29074"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 70901@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 15 16:46:36 2024 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 1s7Fts-0007M9-Eu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 16:46:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7FtP-0000Qb-Eg; Wed, 15 May 2024 10:46:07 -0400 Original-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 1s7FtJ-0000QB-Ip for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 10:46:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7FtJ-0003HL-AQ for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 10:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7FtK-0002CL-2V for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 10:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2024 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70901 X-GNU-PR-Package: emacs Original-Received: via spool by 70901-submit@debbugs.gnu.org id=B70901.17157843228436 (code B ref 70901); Wed, 15 May 2024 14:46:02 +0000 Original-Received: (at 70901) by debbugs.gnu.org; 15 May 2024 14:45:22 +0000 Original-Received: from localhost ([127.0.0.1]:42472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7Fsf-0002C0-8c for submit@debbugs.gnu.org; Wed, 15 May 2024 10:45:21 -0400 Original-Received: from wfhigh7-smtp.messagingengine.com ([64.147.123.158]:40953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7FsY-0002Br-L0 for 70901@debbugs.gnu.org; Wed, 15 May 2024 10:45:20 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 9B16118001AE; Wed, 15 May 2024 10:45:06 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 15 May 2024 10:45:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1715784306; x=1715870706; bh=/5mqltRwPihOKz/x++VWvm/ICY+WYEpdcGhxOy2hixM=; b= bjzPZoq+KK5/h1Rf6w4+3hxvazqNV8DFgYFhk4/uXSbP4yIItqJoM3//oHVN93E6 s/1ioAmeg0zjjUyuZcitAL8v//Ph90RGjv9fKhE+ERp+WVIq5ZXPMvKMp1cKy9bx 7BT4KdzXA8Ou9mIcVIdHOSd60x7gx1f596KLcVBpQIa+vyMgPXJTcA0zdGL/T2aS o3hiPgLllMaYk9HmN2IYFlLvTyuQApK6zs6CI7fogNSy0mevTCAGl8ZY8YtlR4FI YDfbNu2Z7W5WnXcR2B6Bw8FpRo1Nos0Noh6/R2XvlJfUGFgRmJUKIC8jquuTKJ46 FMeeINtwy/dZ3SOG/X/FDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715784306; x= 1715870706; bh=/5mqltRwPihOKz/x++VWvm/ICY+WYEpdcGhxOy2hixM=; b=E lgHyA1/QRBjm9PHj0n+1HOwawFKhs0/eqplp314n7zDGqJthgosjn70I0AgMuMD9 wxQWyO7EqnyodVR4pPefTWXpPCYo9HJr6LqBX8eHQRkVPsZRHNVuW9lsVPIxl+Ft OOUDxBTX+vYZlfO6RCaRCqHyKTTODq4l1kcU7VlQ25rWKRdlnnxSOCbHZOOH8MPp JQjd0ndLTXV2LzVrGxsBOJ6S3eIAx/IUQCUewR5i5wEiP33anPEvvYMX71wk+lFU lFMpD5REZhk2YBWuNSlPNriiJWgnPfoDm4B4SBh/pGqoY1GSuBLkaMywc0XuLRoC ci9tM0HpoZ/2aY5KP9SIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegkedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepueetudfhiedtjeekuefffeehgfffveevteejtdfhteetgeethfevueejkeej gfevnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 May 2024 10:45:05 -0400 (EDT) Content-Language: en-US In-Reply-To: <87y18bebf0.fsf@gmx.de> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285088 Archived-At: Hi Michael, On 15/05/2024 11:17, Michael Albinus wrote: >> Shouldn't it then take advantage of ControlMaster, which has been >> configured for this host? > > It should. You could check which settings will be used by calling > 'ssh -G fencepost.gnu.org'. $ ssh -G fencepost.gnu.org | grep -i control controlmaster auto controlpath /home/dgutov/.ssh/master-fencepost.gnu.org:22 controlpersist 600 >> ssh logs in to the remote server very quickly from the terminal with >> my ControlMaster configuration. >> >> But I don't see any speed improvement in Tramp operations from it. For >> example, I evaluate just 'ls' using M-& (async-shell-command), and the >> time it takes to complete doesn't seem to be affected by the contents >> of my ~/.ssh/config. > > Sure. The connection is fast. But then, Tramp makes an initial > hand-shake, which needs some roundtrips. What gives me pause is that is there is a message in the echo area saying "Connecting ..." which stays there for a while. And that the time to do this does not depend on ControlMaster being enabled - it's around 4 seconds either way. Starting an asynchronous process does start a new connection, right? Simply logging in with ssh to fencepost without ControlMaster takes the same several seconds. And if we put asynchronous processes aside: suppose I restart Emacs and then try to visit a remote file from history. The message Opening connection nil for dgutov@fencepost.gnu.org using ssh... stays around for several seconds. And the length of time it stays around doesn't seem affected by my ControlMaster configuration in .ssh/config (I change the hostname in the config, restart Emacs, try this, change the hostname back, restart Emacs - and the time to connect is the same). So it seems like some problem remains there, which would be nice to try to resolve. > Set > > (add-to-list 'tramp-connection-properties > (list (regexp-quote "/ssh:fencepost.gnu.org:") > "direct-async-process" t)) > > prior connecting the host the very first time in Tramp. This should > improve the speed. Since it doesn't ask for passwords interactively, you > might configure your password via auth-source. Two observations: 1. First of all, it *is* faster. Thank you, a significant improvement. 2. When I invoke async-shell-command for the first time, it takes about a second. And the buffer has "Process *Async Shell Command* finished" at the end. Then, while the *Async Shell Command* buffer exists, I invoke it a second time, it works even faster than that (e.g. 300ms), but at the end the *Async Shell Command* buffer finished with just the output, no "Process *Async Shell Command* finished" text at the end. If I kill the buffer, invoking the command takes ~1 second again. In the first scenario (buffer does not exist), *Messages* contains this: Tramp: Inserting ‘/ssh:dgutov@fencepost.gnu.org:/home/d/dgutov/.tramp_history’...done error: "Cannot resize window #" In the second (buffer exists), just this: -l: finished. I should also note that when async-shell-command is invoked locally, it doesn't print the text "Process *Async Shell Command* finished" in either case. > See the discussion in (info "(tramp)Improving performance of asynchronous > remote processes") I haven't tried it before partly because https://www.gnu.org/software/tramp/#Improving-performance-of-asynchronous-remote-processes still says that tramp-remote-path is not supported (I guess this has been fixed in the master version). And the tramp-own-remote-path thingy is very useful for my work scenario.