From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#61350: Eglot over Tramp freezes with large project Date: Mon, 6 Mar 2023 13:42:31 +0000 Message-ID: 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> <877cvvfnp6.fsf@gmx.de> 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="23901"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thomas Koch , 61350@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 06 14:43:21 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 1pZB7W-00061u-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Mar 2023 14:43:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZB7I-000796-9D; Mon, 06 Mar 2023 08:43:04 -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 1pZB7G-00078a-S8 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:43: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 1pZB7G-0001tM-Ha for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZB7G-0006LO-3R for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Mar 2023 13:43:02 +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.167811017024369 (code B ref 61350); Mon, 06 Mar 2023 13:43:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 6 Mar 2023 13:42:50 +0000 Original-Received: from localhost ([127.0.0.1]:41704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZB74-0006Kz-1M for submit@debbugs.gnu.org; Mon, 06 Mar 2023 08:42:50 -0500 Original-Received: from mail-oi1-f171.google.com ([209.85.167.171]:43702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZB72-0006Kl-4Q for 61350@debbugs.gnu.org; Mon, 06 Mar 2023 08:42:48 -0500 Original-Received: by mail-oi1-f171.google.com with SMTP id bk32so7006146oib.10 for <61350@debbugs.gnu.org>; Mon, 06 Mar 2023 05:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678110162; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BckAk34ZUxoy2h+//a12rUzDmMKekcdi3Kh51DPEavs=; b=nuFHZe8WWRr6W8pHkRbaO0QSt8PY43L8IHEJYK5whK7/6996pEaTVDUqbNn4hYI5tg fkKAvr8V8CbsQJBEHYrMwrlfCNLA4bfBI4cRWWp2Tw2W77eUjWSJt/PoU4+FdyngXm+D 6LtEbUkDvyXx0gxhsCeOSgS3nso+Bya/pc7Ry7g0y05P7pEkYf9LNaoI4DXevfav6Jli pgFBz3cML+K1kpoKIU7+M9PZHRb/8b8fSk4MXmVGUFecA8vPuCt8nDz2WLy/aJv/zdvb AOD0nCqPO9zBDQqUo7BkE1h/5/OjeP7T+zqAEl4iva7jbyQxBkAxPS15VoCafJ8XJ1NS bwLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678110162; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BckAk34ZUxoy2h+//a12rUzDmMKekcdi3Kh51DPEavs=; b=PslrHMqFAe/YRcP7r70YlMG+io/JqTEuwp78gHJBmdAbxtTolKZ2l2oobk9fWvqKVz 9OkqXGgaQCi81vp6Gcj3smxR+SBmH5JOpPBTXiyXV/MM+dt/ObE//Gso8wDPLIlM2c5t u0ymFMLbvtuw+fNqQTwVVTC5Q8lEvNOvb9Io2io4kmFOpmwtIJ8d80NxmO85fHTtv+G2 EgKLcBc41E6jS8Rq5lnzBggWidf/LeNNF9lDN+7mfCzBIeAelUHXlHzC8P8LI6J/TmG4 kW/hEcqIIQkulnnlvrxLRydFTA9bYer+eKdvqSOxn9klUgJweHyCV3aPRwbHstZeT8cM RdHg== X-Gm-Message-State: AO0yUKXsbzljvvrca2iO09mHt/SOMVUL/bDd6ZD2JsDoc+C32FHN5N4n dBS7bs/tuHZlGRFTm34svb/yJ9sGrQuDekN5se4= X-Google-Smtp-Source: AK7set9MVKbjUKvNPq0uysLsGSZO9eLgkOuZirO98TrENGeBIbIG0Sd5NkGfErkrY0sy0DUq2mpH5ppGjtx2jZV4EGA= X-Received: by 2002:aca:240d:0:b0:384:22aa:f4cf with SMTP id n13-20020aca240d000000b0038422aaf4cfmr2990224oic.8.1678110162049; Mon, 06 Mar 2023 05:42:42 -0800 (PST) In-Reply-To: <877cvvfnp6.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:257393 Archived-At: On Sun, Mar 5, 2023 at 11:21=E2=80=AFAM Michael Albinus wrote: > > 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 ControlMa= ster. > > - 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. OK, I think I understand. But here, the main point that makes this deadlock possible is that tramp when called by the jsonrpc process filter is calling accept-process-output with JUST-THIS-ONE set to true. _That_ is why jsonrpc--process-filter cannot see the remaining output that is stuckl in the ssh socket, as you describe. > The proper solution is indeed to have two connections, and to refuse use > of ControlMaster. Here, I disagree. I think, like Thomas, that the proper solution is to stop passing JUST-THIS-ONE to tramp's a-p-output calls. > 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. I don't think using this hook for this is the right idea, and I'm fine with having that bit of Tramp-specific code in there until we find a better solution. So no need to worry about that. Jo=C3=A3o