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 22:55:18 +0300 Message-ID: <9287b788-a366-48b2-8d8f-8f48d6144fac@gutov.dev> 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> <871q63djrv.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3689"; 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 21:56:17 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 1s7KjX-0000iE-UI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 21:56:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7KjK-0003iC-82; Wed, 15 May 2024 15:56:02 -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 1s7KjI-0003h6-TK for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 15:56:00 -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 1s7KjI-0002lV-LJ for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 15:56:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7KjK-0006qL-1h for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 15:56: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 19:56: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.171580293426297 (code B ref 70901); Wed, 15 May 2024 19:56:02 +0000 Original-Received: (at 70901) by debbugs.gnu.org; 15 May 2024 19:55:34 +0000 Original-Received: from localhost ([127.0.0.1]:44136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7Kis-0006q5-9P for submit@debbugs.gnu.org; Wed, 15 May 2024 15:55:34 -0400 Original-Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]:32947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7Kip-0006pz-Tw for 70901@debbugs.gnu.org; Wed, 15 May 2024 15:55:33 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.west.internal (Postfix) with ESMTP id DFC8C1C000AE; Wed, 15 May 2024 15:55:23 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 15 May 2024 15:55:24 -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=1715802922; x=1715889322; bh=+quPt0Dw16V3lX1WR8DSPqVVCOpmPsvvpnhupXVgH30=; b= VSTtAzgXJiS07a0kn8iESIsoefg4HA/rV8ILwDJ3q4k3jN6N9KFl64VlWd8C2te7 MM5Uv0G567cRykdSSsMb1CTRjMYgwa+i9ceUxwFrqsyJ72V5cWZla9jiloWOBlJm ns69xqqP2fWx7iB0ogBi7Tsb3biyScIizl91Kt+TMlilq1rrIUmo6V4cI4KTv8iS c/K04ViiPiMeFi9tsMUAf7nDEPMwpcGkKsvtXLbrXoiB/9aIYu0tgiri7QgMjlf9 Poliv1M+iaKzAB/1ZRWRpBS6+0hSjDXv5EGvv8C/W4AvHsb0vrbxr5jtxAmCUSZr AM99J8jiOIAb5jvDRZJkqw== 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=1715802922; x= 1715889322; bh=+quPt0Dw16V3lX1WR8DSPqVVCOpmPsvvpnhupXVgH30=; b=e Zi8wfBU/gYqCtgIYJqivMk67A1CTmOB2uIEye4ntKrBpAh/hpIYqpmCHf2Y+qJv3 pZZvDwvYwMWaMPre5Rp9N/fJ3CSmmnLof/f5Fn8jmS45mhlz5eB+DYNO8UcHe1Ur roX4PLRx40ZmShdYrDfnrMAKhFJ8qidTVQWh448jkUPtw3lblOrlbBppwJT1Ngdr O/klsYH1+MtmN35zH/8r4/FedjKTSCjjwwHnft8ld4wAjS8OsFfT2Nvy9v44OH2F +0HtahQ2R/b53KW158HBWKaYnFM/kub2S0FuBt/F7FnTM8Jr5OnTgpEsMwZrriHR UzXrtqwW2NsfISP8IoVmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegkedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeffieefvdelueektdfgleeigedugfevkeefjeevjeffteffueeuueeghfev ieduvdenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 May 2024 15:55:21 -0400 (EDT) Content-Language: en-US In-Reply-To: <871q63djrv.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:285119 Archived-At: Hi Michael, On 15/05/2024 21:15, Michael Albinus wrote: >>>> 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. > > Well, the message is there not only waiting for the network connection, > but also waiting for Tramp doing its initialization. So you cannot > compare the time with a simple "ssh ..." from the shell. But it looks very similar to the time "ssh ..." takes in the shell. Except when I set up ControlMaster for the host, "ssh ..." in the shell starts taking much less time (not having to establish a new connection, I take it). Whereas the time it takes for Tramp to finish "Connecting ..." seems unchanged. >> And that the time to do this does not depend on ControlMaster being >> enabled - it's around 4 seconds either way. > > Yes, because the majority of the time is spent in roundtrips during > initialization. Does that mean that, somehow, Tramp is faster at establishing the new connection than the terminal ssh? Then it would make sense that the rest of the time is taken by additional work. >> 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. > > Again, it isn't only the ControlMaster option. And it depends also, > whether there is already an existing connection, which can be reused. I test and compare by restarting Emacs at the beginning of each scenario, or killing the existing connection anyway. We're supposed to reuse the external connection established by ControlMaster, right? I mean, at least at the lower level of the implementation. >> 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. > > The "Process ... finished" message comes from a sentinel, IIRC. Tramp > tries to handle it properly, but there might be a bug. Do you mind to > open a new bug report? Okay, I'll do that soon-ish. >>> 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. > > The web page refers to Tramp's stable version, which is 2.6.3 ATM (the > version in Emacs 29.3). If you build Emacs yourself, you're better to > consult the Info pages. The rerstriction you mention has been removed in > tramp.texi a while ago, and etc/NEWS says > > --8<---------------cut here---------------start------------->8--- > *** Direct asynchronous processes use 'tramp-remote-path'. > When a direct asynchronous process is invoked, it uses 'tramp-remote-path' > for setting the remote PATH environment variable. > --8<---------------cut here---------------end--------------->8--- That makes sense, thank you.