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: Tue, 07 Mar 2023 13:49:31 +0100 Message-ID: <87a60ovi90.fsf@gmx.de> References: <87y1ootw2t.fsf@gmail.com> <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> <54377687.213790.1678016749459@office.mailbox.org> <87356jfktc.fsf@gmx.de> 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="17630"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 61350@debbugs.gnu.org To: Thomas Koch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 07 13:50: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 1pZWlv-0004Dw-4X for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Mar 2023 13:50:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZWlY-0003vW-M7; Tue, 07 Mar 2023 07:50: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 1pZWlX-0003uw-1T for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 07:50: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 1pZWlW-00046m-Nv for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 07:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZWlW-0002OW-GV for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 07:50: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: Tue, 07 Mar 2023 12:50: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.16781933819162 (code B ref 61350); Tue, 07 Mar 2023 12:50:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 7 Mar 2023 12:49:41 +0000 Original-Received: from localhost ([127.0.0.1]:44745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWlA-0002Nh-To for submit@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:41 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:50115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZWl9-0002NU-DC for 61350@debbugs.gnu.org; Tue, 07 Mar 2023 07:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1678193373; i=michael.albinus@gmx.de; bh=rWbyhRqie3Ea5+oy5CZoF7LVsLCVbPij6FrGdpx5lQs=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=knWL7v1ueFXF17TpdhbW5SiLdJRE1SkjoyT8euj3gXT370BojUABCt2i6O/LdIld3 3HQ2l/vECUAlbA1uAzlI7qtPRvQd5ZOQAzJbciSTs/Tsl6f4+fpmpG+5NoOSN3FyUH 8NmJsxZyKB+nrg6N/vMoJ3Vw79Tz7WhA6i0G5BaiqXFUvxpaz75F7hdTRKAVYqS5t9 VCWPb0vfVMi+qFmECHRpsIIuQnOObHddPD5n5I6p1OVK++aEVK+jAfFz1luyRED9W2 +AGyb10U3vjEDUi1QzaN6lz3l8Hg3qrpf2mnX+evQw6JdJiIRYIvQlbbnTlXzFSq6A G0xxG3BfeIkEQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTAFb-1q0FM20VjD-00UcNu; Tue, 07 Mar 2023 13:49:33 +0100 In-Reply-To: <87356jfktc.fsf@gmx.de> (Michael Albinus's message of "Sun, 05 Mar 2023 13:23:59 +0100") X-Provags-ID: V03:K1:xkhfull5VF1LRPt6Irh+kcjkTqYjPcadDDhMmuwo+AxbhKx7a4D QjQ/qNwtsjeG2UhkZUDbkC/N8ENlKcgkltRT6dvqY1wTDmvCCbJ1mYFkp0DkhdaZVv3K3ol GI/qyzttr+5M85oOGF6KhPio2O35CSo/gfFXtOFVbW6cMm8ClOKFFbR1T86ORfVTadEmroS auGgT4MFaIucbBGfyy51A== UI-OutboundReport: notjunk:1;M01:P0:uNCCPjuAZ24=;mLA9g4p92Rt1+wH/DZHfft5cpBL z+ncEic6B2mXKC4brkhNfV6g+7vbiGxrAaDOL9HirJ419+aHanGe4GFtSN1ocbk9AedT9LCMG mw5XVs7j9LgXUOKyw6KmoiDav6qRQNHkXt7mbX8fyAtuSggYWcCHn68gtKdLU4qLpP64srLR0 O56GkeQ+tFBbMtvjmElSFUI2ww19zZRFpjK1oGoSVrchLA6PTsAtDFcnu30a9Paovrg+8D9Dr vnFEely7aR7izQZ9cqVBNgsAIcam64yU17oMTMQxQORBsk8C5KzAwP5hKhMlqdNQWosG8QYen Z9FYzW00A6uqY/YrfFelZwFDZRRyFVlr+Kj3Br94HhBF+FCU4YwTFt2jTtEcurpRjc5pxao5g DxK/aDqzwa7ZkxBhiNgCTxbo2mdeytvaipNX4b6a/jZRGyBwLcDm00+guDYnjfnFiToSj1zR1 Eo70qcA67qf/YztkeHbA2aqzcG7vj6JxHIpMSmdV+aow4DifpSEEX2Mu/Z+EvRw1x4rNwEMah 3C5G2hAnMuZNIvIm/uE0nz9c3ByMLuagm4IknSpVrZERyysKh4Fp0qRlJofLvf8zs/xQeZwTR jduarkdFCPWFlBYO78/32uYjfJRKYwy1zIGiwAXFfbUg8sg/0mXK7WM6tPVClf2ezZKDErdnC vnvXHa9ZDccpaj7kSYl/WO9DBJDa/HSNkri+yv/sFPC6b77qkamGyyRQFChsmcanHtPjcThuO /BIETb8IudMuiSwmd5W8aUtwtjB48Mplxh9RyBqtQOl+6ZWC8bmqMimnhUarl70geoipCxqY 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:257441 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Albinus writes: Hi Thomas & Jo=C3=A3o, before going offline just a short status update. >> However my conclusion is different. I consider the root-cause to be >> the use of JUST-THIS-ONE in tramps call to >> accept-process-output. Please check my comment to bug >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12145 > > I've seen this. And yes, we shall fix the problems described there. > >> As a practical roadmap you could add an option to Tramp to disable >> JUST-THIS-ONE and recommend its use. Later the options default could >> be toggled. Eventually the option can go away. > > Might be applicable in the master branch. But first we need much more > checks that it doesn't break something else. > > I'm always uncomfortable to change Tramp such a way that other packages > could be broken. Letting Tramp accept process output for all existing > processes doesn't seem to be the right thing to me, although I admit > that it seems to fix the specific problem we're discussing here. Thinking about, I came to a less invasive idea: Just the processes which possibly use the same socket for the ssh connection should accept their output in time. This avoids to change the behavior of other processes, which are not related to a given Tramp connection. And it makes me feel much better :-) The small patch below, on top of Tramp 2.6.0.2, seems to fix the problem. I've also deactivated (in Emacs 29) Jo=C3=A3o's Tramp fix, and I've applied the recipe given by Thomas 10 times in a row, always starting with "emacs -Q ...". 10 times success. Could you please check how it works in your environment? You'll have some days until I'll be back. If it also works for you, I will add it to Tramp 2.6.0.3, and we could close this bug. For completeness, tramp-test44-asynchronous-requests now fails in tramp-tests.el. But this test is already flaky (not passing successfully every time), so I'll investigate later what's up with this. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment diff --git a/lisp/tramp.el b/lisp/tramp.el index 24b7c45d..50945ccb 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -5746,6 +5746,17 @@ Mostly useful to protect BODY from being interrupted by timers." This is needed in order to hide `last-coding-system-used', which is set for process communication also. If the user quits via `C-g', it is propagated up to `tramp-file-name-handler'." + ;; There could be other processes which use the same socket for + ;; communication. This could block the output for the current + ;; process. Read such output first. (Bug#61350) + ;; If `timeout' is nil, `accept-process-output' for `proc' could + ;; block another such a process. So we set `timeout' to 0 then. + (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))) + (with-current-buffer (process-buffer proc) (let ((inhibit-read-only t) last-coding-system-used --=-=-=--