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#62093: [PATCH] Let processes read nothing from stdin in tramp Date: Sat, 11 Nov 2023 14:08:18 +0100 Message-ID: <87y1f430al.fsf@gmx.de> References: <87wmvaudbi.fsf@n90.eu> <87edh5s9e9.fsf@gmx.de> <877cmupx1c.fsf@n90.eu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10585"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Benjamin Orthen , 62093@debbugs.gnu.org To: Aleksander Trofimowicz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 11 14:09:47 2023 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 1r1nkA-0002cs-FD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Nov 2023 14:09:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1njo-0000at-Nv; Sat, 11 Nov 2023 08:09:24 -0500 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 1r1njm-0000aW-Ko for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 08:09:22 -0500 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 1r1njm-00079O-CN for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 08:09:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1nkQ-0005ps-AV for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Nov 2023 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62093 X-GNU-PR-Package: emacs Original-Received: via spool by 62093-submit@debbugs.gnu.org id=B62093.169970815122371 (code B ref 62093); Sat, 11 Nov 2023 13:10:02 +0000 Original-Received: (at 62093) by debbugs.gnu.org; 11 Nov 2023 13:09:11 +0000 Original-Received: from localhost ([127.0.0.1]:52307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1nja-0005ol-IQ for submit@debbugs.gnu.org; Sat, 11 Nov 2023 08:09:10 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:59305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1njX-0005oH-GF for 62093@debbugs.gnu.org; Sat, 11 Nov 2023 08:09:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1699708099; x=1700312899; i=michael.albinus@gmx.de; bh=SR+bm96tu9d8eNjhGn42jVJUcJm84E0aVF3JUcEByg0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=jNpbprMnrfsjGIrimALQB4oOO4nozmvPFgxdZZ6837K3Ghzz7HnXncKU4hLZY3FY 59zuO2zYlnFdkN6YbaGyCxFnwcQ0P2blwQW+M3u5SiGP7cPvywOSeQDAIup0rdlNQ 7IJO76vrX155l/Rxp9Fl63XeO5p1QKwPfWdI6fMNq553qi8IzgsLOSp26kgbgpvOV 3g2HFrsq9YH1IXTagnlrvOneoGsC5dVUB8+4Zi6WklrbdmA9DwHCrYE0Uk6lP5R2b J6taapnT0AWOyMrD5N5P6983CFwplQMzacPp+19L8CQsrDZqOGT7Y1Mb8kX3STrDg f+j4cGA4XZ1gjxeALQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M2O6e-1qxwNB2glK-003v10; Sat, 11 Nov 2023 14:08:19 +0100 In-Reply-To: <877cmupx1c.fsf@n90.eu> (Aleksander Trofimowicz's message of "Mon, 06 Nov 2023 16:51:24 +0000") X-Provags-ID: V03:K1:peFAtsC/Qg1QNT0bAq485JqJ3+7MK7nOkfmRBRNir4FfjEWeqIg iocv5liTp9+B+VTe2pTzzThGSuSY9n2K8wawQ6fp2FUDCKAAfszNcSjh4ylUc0Ig37Tag4/ zhX9aRrTQpfLEO+rqAjicw3o8bmqrDRLE2bXqGvQtL9DtVV+EjwRWezp5vwI7p7DdFB/p1H dTz8J0MmurWNOmTPnUvyQ== UI-OutboundReport: notjunk:1;M01:P0:t/OcOJStvE0=;w86Ia9OkNlmbnhcTMgBLidebMtr /AL9r30PqU804Z/BsTFTsMXb4WXs5xCvHRCrjc1aBPBZmU27sHW8NyVaijmW8JMb2xMWCffZ5 7c2XjFQCFkJc9PkQzroWgybPiHDAhqdEhSbqrygDR4ZCaBiIMzUsvv8A5nmIAkxwp+JP+5eJG uFZOcfv6fNb9gpo9PnkeuUmHU+334BQJ6KQC8EwjmxwGvqpkvCoL7IeoLwr5r7MSc3nv3Htg6 +iEyu2788jxVuw5ejmbmmNzqQ8GPnvFvaSPqL+6leBNEYeLD4Rt39/tXX/yyDOVrai2P1i1f0 4voQuSTC+ZtdBnWPJyhbk6IwCKNlMKgP4R+vM+YZh3rgCR7PxqRWXsglZEhtaZe5fySfGDjCE pZwWDgvxIg1HiZg9XH3Y99BnzhIeBC43PPq+v5vohDlK51G+SvW9QA50jIcGk30nHKgJToa2Q i5OW5QmbWggeITv5lAy44weiG4fVK3PVlsMPIKRC0mr3pPXoTVk3prcudXWZtnhBRljtH+f9w ggrM4Kzz+108rtUSiqg3wa7tpHDM2PinERKPpsLtBeM/JZlZeIvFIuR91PWfR++wpwFmdnmvb JGjDp4DqCRKnnc68nvIxFRY2OYSWaSyG38YWQQbCj2L/9FwSJpM9DqyLDmvGV9YHp/C6FJfNm YPa22CcKYCvMhhwak+XxemlrXWPzXZKHtiQVqvQSEWLS0KqCrNTHSOxfO+/LJ8qLskFb5BKxR 2W9FIixdFfMh06s9tZFrmTfahAsvElXO3U1TKCftZKhbFIkug+WfpnxVWZRekETA0OTOfTwM 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:274161 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Aleksander Trofimowicz writes: > Hi Michael, Hi Alexander, >> The failed test runs have in common that there is a complex Tramp target >> for the test using multi-hops, like above. I suspect a problem with >> timing due to the several hops, but I don't know exactly what's up. >> > Triggered by your multi-hop tests (host B via host A) I run git-apply > actions over Tramp with the patch I submitted. I settled with 3 > different test environment configurations; all of them should provide > the same functionality: > > 1. An explicit multi-hop target "/ssh:host_A|/ssh:host_B:..." > > 2. The SSH client option ProxyCommand set to "ssh host_A nc host_B 22" and > simple "/ssh:host_B" > > 3. The SSH client option ProxyJump set to "host_A" and simple "/ssh:host_= B" > > tramp-use-connection-share was set to nil in each case. > > It worked as expected only in the first two cases. As far as the last one > is concerned, the workflow wasn't stalled, but it turned out to be no-op > after all. > > It seems the last test environment enables the most responsive data > stream: no additional userland process is forked on a middle box and > Nagle's algorithm is disabled for all TCP connections involved (which is > not true for the case no 2.). In the end such results might corroborate > your theory. Well, I've tried deeper debugging with this. But for whatever values I've taken for stty's min and time in tramp-sh-handle-make-process, there were always cases it didn't work. Rare cases, and not always reproducible due to race conditions, but they exist. Going a step back to magit, I see the following comment in magit-start-proc= ess: --8<---------------cut here---------------start------------->8--- ;; Don't use a pty, because it would set icrnl ;; which would modify the input (issue #20). --8<---------------cut here---------------end--------------->8--- I cannot speak for the local case. But in Tramp, we need to set "stty -icanon ..." for the pipe connection type in order avoid blocking situations with larger hunks of data, see the comment there. And the use case of magit-start-process would be better with the connection type pty, at least when calling Tramp. The appended (rather na=C3=AFve) patch fixes the reported use case in my local enviroment. > at Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** /home/albinus/.emacs.d/elpa/magit-20231103.1516/magit-process.el~ 2023-11-04 11:43:11.848351502 +0100 --- /home/albinus/.emacs.d/elpa/magit-20231103.1516/magit-process.el 2023-11-11 13:26:23.212027014 +0100 *************** *** 583,589 **** (let ((process-connection-type ;; Don't use a pty, because it would set icrnl ;; which would modify the input (issue #20). ! (and (not input) magit-process-connection-type)) (process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) (apply #'start-file-process --- 583,590 ---- (let ((process-connection-type ;; Don't use a pty, because it would set icrnl ;; which would modify the input (issue #20). ! (or (and (file-remote-p default-directory) t) ! (and (not input) magit-process-connection-type))) (process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) (apply #'start-file-process --=-=-=--