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#61350: Eglot over Tramp freezes with large project Date: Sun, 05 Mar 2023 12:21:41 +0100 Message-ID: <877cvvfnp6.fsf@gmx.de> References: <87y1ootw2t.fsf@gmail.com> <69968923.705640.1677163650760@office.mailbox.org> <87a613f0b7.fsf@gmx.de> <87r0udvmzr.fsf@gmx.de> <878rglxrzm.fsf@gmail.com> <87cz5wmjbx.fsf@gmx.de> <87h6v8f7u9.fsf@gmail.com> <87o7pflfcd.fsf@gmx.de> <87wn43e9ht.fsf@gmail.com> <874jr6oont.fsf@gmx.de> <87sfeqd4zi.fsf@gmail.com> <877cw1swjm.fsf@gmx.de> <87k0016dgo.fsf@gmx.de> <1458446553.50372.1677606917251@office.mailbox.org> <87ilfkh89k.fsf@gmail.com> <87y1ofct83.fsf@gmx.de> <87356n8kja.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31411"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Thomas Koch , 61350@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 05 12:22:24 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 1pYmRb-0007xI-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Mar 2023 12:22:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYmRK-0002Xb-BM; Sun, 05 Mar 2023 06:22:06 -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 1pYmRG-0002XD-E6 for bug-gnu-emacs@gnu.org; Sun, 05 Mar 2023 06:22:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYmRG-0002yk-6U for bug-gnu-emacs@gnu.org; Sun, 05 Mar 2023 06:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYmRG-0002yr-1h for bug-gnu-emacs@gnu.org; Sun, 05 Mar 2023 06:22: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: Sun, 05 Mar 2023 11:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61350 X-GNU-PR-Package: emacs Original-Received: via spool by 61350-submit@debbugs.gnu.org id=B61350.167801531411445 (code B ref 61350); Sun, 05 Mar 2023 11:22:01 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 5 Mar 2023 11:21:54 +0000 Original-Received: from localhost ([127.0.0.1]:38621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYmR8-0002yW-50 for submit@debbugs.gnu.org; Sun, 05 Mar 2023 06:21:54 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:49573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYmR5-0002yG-KC for 61350@debbugs.gnu.org; Sun, 05 Mar 2023 06:21:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1678015305; i=michael.albinus@gmx.de; bh=gJJUaOWxActNEyL/WpeeDftTzvk4EhLRRNRQSEy/Zyo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=fhQOw5V3VB+7yjgFtqv84Qa/uV4Mia4YOdS/yQwu/nmIg9lk0MYKdD15raBgNmDmd KqDTFscgvVcbpaoJ3GVlX+3aCruNP3PAj/kpsRkPUo2kOj5aFaCADqdBB42CuBcvXP NA7YbLfvCqPNgs/Cg5rBEg48vsOgVyxt0lCxpoa0diOwfWYE5g5ZUSo90c9TupvgNO ArTP3RrnsqOXyj4Y9d9OPH1jfanptHxdK0iGwxpj42/f8rEFjTeDOosSHLGdDgKPs0 H8FDA406f583x9BuP69ZFsWGuf72sYTkH5Wpg7zSMmpshWPLp7cXxZ9b4Ty+j+Nxmk YzUQebuMpJoXA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mr9Bk-1qKiS63YYA-00oBpz; Sun, 05 Mar 2023 12:21:44 +0100 In-Reply-To: <87356n8kja.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Thu, 02 Mar 2023 11:22:49 +0000") X-Provags-ID: V03:K1:mIhavm5Hon4bOpj2WhYw31QDQWDXFg51RVpSLi8hzJgrTd22Z6M IG8MyOqwX91ZDf7+wqIZZCMo5NJtrGhaUxgkAf/VeirlUjPUfLu66vLBC6WFilJWvc7a2el 5ADW7+l7sX8K5aMGhFL4KXVPZuiIrp+t+fqCchA5E/gXmQSNvU1C8oiSkSu0ZgLKDfkxnfL uhjFXB2zBfvI6V8I9ztMQ== UI-OutboundReport: notjunk:1;M01:P0:RGVj8o4QsYs=;KCd9tf88HPUt5lJJN1OFWTNdeJH Qt/8K5xXu2ELK/Cg1ULdFIHkNQjPInIt+B6+E8874Vx0VBA97EokApoAA6PP+TBhhrJVgozWC 6vdnQbxMxE6QxgmxroF9SaWkLmDADaE6FJNOqbDb3Zblin/lC0zJqu3C7YAaBagBm+mr5BsHp vbHhnvtrjI+qU8WP/uLxFkS9vMcyFMDOZhAQ2AZniX0WGQ6pjZhV2CSMrgno+xWmL97Fco+2e doK4wu2Wa04wC4raLdUpdhUr395gj98e6g4QBMYMrkpKonbAKkrKhpy9Lx0bPF9HBMyWzKXNL +r6F8tdZ3GS5ar7zxUgR2nDA7LH24dNoAj2sxV2moT7YQBtR8PxoqSxSWM1RTykRHYWArAhkI Y3lBwdxSs/SJ+CgyGvIhjAz2RJ4FE3SJ14Bj7n1BiHdkMJRYKJVvWdyeUMdSpprj+2U9LqCeA 0J/xWKp0PF9i7ZzV3l/ZmaBGk6E7/KSly3y7ifNbFNkOJiFeU0lO7HjUftYFYs+lazNGSmYeF pPlIc9f/uYuXeoEXADVG08P/3FuRfjoOwJ4dmDIDC5rvMEc9MxwE7edEY0QgqxxbOZYhGpfD9 XYRzEcNbgPZ5IwykPIaJ9Jrr4nKw5QKFJmu2FeqgFc3EiFUlWHAPVEaKou8fqIMCflP4Zh6Zf ulnkpYdcuP5fZGL1g7Yl2pZQHBgK8Jscpp68c/0j+DyNMpYyhyXbr6fs94f88uMIZGeh/jbuB xKJ9BlxOCI3W/ZT9kPi1NPJMjFE88hl/GXCSMZGvNSLMq+Y5vj9sINP6dytgGOBvfHXY01ib 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:257347 Archived-At: Jo=C3=A3o T=C3=A1vora writes: Hi Jo=C3=A3o, >> Yes. But Tramp calls accept-process-output only, if it has send a >> command to the remote shell, and it expects something to be returned. At >> least the shell prompt. > > Yes. Tramp is doing the right thing. It really expects a response to > come. And more often than not, it does. But sometimes it doesn't, and > that's when we hang. After digging further, I believe I understand now why it hangs. We have the following scenario: - Both Eglot and Tramp use the same ssh connection with enabled ControlMast= er. - Eglot gets JSON output from the remote LSP server. In jsonrpc--process-filter, this output is handled. It includes a call to file-truename, which triggers Tramp to send a request in its own process to the remote side. - The remote side returns the answer for Tramp (shell output). However, the ssh socket is still full of the jsonrpc process output, which waits to be handled. - So the socket is blocked. The jsonrpc output cannot be read, because jsonrpc--process-filter waits for the result of file-truename. And the Tramp process output cannot be handled, because it is stuck in the socket after the jsonrpc output. The proper solution is indeed to have two connections, and to refuse use of ControlMaster. Surprisingly, this is not new to Tramp :-) But I've simply forgotten the case ... See tramp-integration.el. There is a comment for bug#45518, a similar blocking in compile.el. And the solution is indeed to disable ssh ControlMaster. Tramp hooks into compilation-mode-hook, and sets tramp-use-ssh-controlmaster-options buffer-local to nil. I'd like to apply the same solution for eglot.el. Unfortunately, there's no hook Tramp could use. I've played with eglot-server-initialized-hook, but this is applied too late. So would you mind to add a hook to Eglot, which runs before calling make-process, but in the proper process buffer? When you've added it, I'll let Tramp hook into, and you don't need any longer the Tramp specific code in eglot.el. In parallel, I'll extend tramp-use-ssh-controlmaster-options to accept a further value 'suppress', which overrides possible settings in ~/.ssh/confi= g. > Jo=C3=A3o Best regards, Michael.