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: Sat, 11 Mar 2023 13:44:33 +0100 Message-ID: <87fsabh2z2.fsf@gmx.de> References: <87y1ootw2t.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> <54377687.213790.1678016749459@office.mailbox.org> <87356jfktc.fsf@gmx.de> <87a60ovi90.fsf@gmx.de> <31964054.380679.1678194256931@office.mailbox.org> <87r0u0u0rl.fsf@gmx.de> <87mt4otyy1.fsf@gmx.de> <87pm9fk6ht.fsf@gmx.de> <87mt4jzf8q.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="13820"; 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 Sat Mar 11 13:45:29 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 1paybH-0003Nu-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Mar 2023 13:45:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1payax-0002Sb-06; Sat, 11 Mar 2023 07:45:07 -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 1payas-0002Qr-U4 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 07:45:03 -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 1payas-0006J3-B4 for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 07:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1payar-00018b-SF for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2023 07:45:01 -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 Mar 2023 12:45: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.16785386834330 (code B ref 61350); Sat, 11 Mar 2023 12:45:01 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 11 Mar 2023 12:44:43 +0000 Original-Received: from localhost ([127.0.0.1]:56753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1payaY-00017m-VO for submit@debbugs.gnu.org; Sat, 11 Mar 2023 07:44:43 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:35611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1payaX-00017Z-Fk for 61350@debbugs.gnu.org; Sat, 11 Mar 2023 07:44:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1678538674; i=michael.albinus@gmx.de; bh=41oiGz8j1s5VF4sHpJ1UeIqrCL6Poh/l9mLqTITTVjY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=uAO0eWHLlUJyVTSj12MwAiMx2WK/QxVHmqfKRpfdQp9419EOYwU46J6e2DagWI20k E62645zL+6RRC4RqWroEjVb3dG8z75hJW87nXw60EjE0Q84Bqrm5N0BiGop4y8FPVB 9+2RsmlT+DpTUfSTHG4BveGmSfbOwEgzMCCGGSo8/3QSp0GUkCucKFN4F/L476iM2H 3AdjzX9oeELorymGnkpbP1lbsqVbv7r3E0eeYbT4QCbVegRIJAk5ode6z+56fdaslc o1kMWz1df+cZqHoqQev4Dhohzj27IVqITxzSAlWzDeV14Icm0ZUDnc+UZphjgiK/Xx NFwKCh3hFj7gg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MIMfc-1pn1GQ2bZs-00ENhX; Sat, 11 Mar 2023 13:44:34 +0100 In-Reply-To: <87mt4jzf8q.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 11 Mar 2023 11:42:13 +0000") X-Provags-ID: V03:K1:CxU9JP04PNEXqCvwybX3CbzRgnH4EJcxlq48AAJ1quhrsUgoknX PnD5xl3glQs7mSfC3ldvzFbEIagpz+fUOA+E0r0MiaYurJFUX3E3D7Hx+2LxvP8E3w7PDPR tVBSmUl8aKEsNO6MA5T7WWrof34iw+PtDcdO6E5TXSx+8EAm5IIKO7dCQ22fCrKV7ZnoC2y cEKrFc6Z/PMskkiUnoRRA== UI-OutboundReport: notjunk:1;M01:P0:LQGr5eS12Go=;IVnMC/JQ1SRM6hrlEN6F4pD8NLC cc0tFWu+dbU8mZstbXl5QDAjbtPpQY0qL1p77BKEB5NLn43UduZXiZEYZ1qYxl5aTXQfjReYZ P5GXS+Uh9sSQXVJFQqqRN9x4fBHFz8WsInannNjjIgDJL7r0yyTWO2+R9xpDYxrCExBnpQBBB oJ7nmhxsn4RZjbemC1OVp8L1ZZdcUQ/DHv9EnfTOJ+xvTzUldV/fGp2OTweviBVaTAIxT6Y31 9tbIrAnYciajZ8UWreHIPBnUf3oeegvw9zhYi+y6ilCWsT0axHfurnk8a2B+pdFl+LJNaxfF5 Fzf0EtMmzboknUv44z4UFxA6S5bXNEB0sY9VUi3jpYZFBy6KcnBv/3AQkEooZkcTDeibDHBkq 7AeIFPZQJ2drqIF4OrTSvH0Jw7autxfQg+IwOcP7gUoOmUE+jLmdpLwSYiEGKle3ogZz7R4Hh ydqVf1zOi9HYsgByWbFfMi5CSjCev3dyNWB1Z6V9JplqjPrPYQz82V2Mnw/wzYLdhndUAT01p T8r7wcko5IaKuF13VRfzLtK2Fd+XMo0UlF3NpQPAn0Nwft7tb7cSp7+cDZMbaAvxsaPeimTnP u7lYQatHCm2aXSlrQ7o4g9JmbhtTuPG+cHEkvkJhRjFyO+jWEBHzRmeqCZ3c05QR96QXHxDCi E85XqLznYp1VE8llXeTV9hd/cQH7hZBWw30csKghCwTg5x/b6TiSnvJim/E+iook8Ffx1JdZp vPiaCDMbF/fIn7T5P4dVIsWDkcpeNJGoru9220LEkW8rHhGjA+ktw1cCXACpHcNkJkSBTD1P 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:257789 Archived-At: Jo=C3=A3o T=C3=A1vora writes: Hi Jo=C3=A3o, > I think the patch goes in the right direction. The force resetting of > 'timeout' to 0, which you highlighted earlier, is odd. Yes. But I've tried first w/o this setting, and the recipe from Thomas still didn't work. > + (dolist (p (delq proc (process-list))) > + (when (tramp-file-name-equal-p > + (process-get proc 'vector) (process-get p 'vector)) > + (setq timeout (or timeout 0)) > + (accept-process-output p 0 nil t))) > > That's because callers of 'tramp-accept-process-output' who call it with > TIMEOUT=3Dnil will now see their expectations violated depending on > conditions they do not control. You fully control these callers, so you > may know better, but I think this patch makes more sense, because it > keeps the contract.=20=20 In fact, I'm even not sure that a nil timeout is still needed. This is something from the very beginning of Tramp. Maybe I shall review the code whether we still need a nil timeout. Because its initial idea, wait in accept-process-output until the remote shell prompt appears, is no longer needed, because we call tramp-accept-process-output (and therefore accept-process-output) in a loop. This is something to be changed later on. A short scan over the Tramp sources shows, that there are 12 calls of tramp-accept-process-output with a TIMEOUT of 0, and only two other calls with a nil TIMEOUT. And these two calls are already in while loop, so I guess it would be also OK to give them a default TIMEOUT of 0. I will try it, but this needs lot of regression tests (I have 100+ different configurations to run tramp-tests.el). > + (dolist (p (delq proc (process-list))) > + (when (tramp-file-name-equal-p > + (process-get proc 'vector) (process-get p 'vector)) > + (while (accept-process-output p 0 nil t)))) > (with-current-buffer (process-buffer proc) > (let ((inhibit-read-only t) > last-coding-system-used > > This is even more "conservative" than your patch, because it deviates > less from the current behaviour. I've tested it (first removing the > eglot.el workaround) with my reproduction recipe to a 100% success rate > in 6-7 experiments (whereas without it it is 0%). Hmm, in my experience there were still one or two blocking tests wit Thomas' recipe, IIRC. This is because the blocking situation, data is going through the only ssh socket for both tramp-accept-process-output and jsonrpc, is not unblocked then. So I would prefer to keep this (setq timeout (or timeout 0)) for now. And I will reviw the code, whether tramp-accept-process-output still needs a TIMEOUT ARGUMENT as sketched above. >> I plan to install the patch next days on master, unless you oppose. > > I don't, but consider my alternative. I consider it by removing the TIMEOUT argument, if possible. > Jo=C3=A3o > > PS: And I also think that Eglot over Tramp does seem to have become > faster with ControlMaster, at least in a subjective evaluation. Of course. That is the reason behind using it. Best regards, Michael.