From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Date: Sun, 08 Sep 2024 18:41:20 +0300 Message-ID: <86cylew3tr.fsf@gnu.org> References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> <86a5gk28ht.fsf@gnu.org> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 08 17:42:13 2024 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 1snK3J-0004jv-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Sep 2024 17:42:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snK39-0003mN-T7; Sun, 08 Sep 2024 11:42:03 -0400 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 1snK36-0003lq-6N for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 11:42:00 -0400 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 1snK35-00058R-UG for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 11:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=AsJr0kdH1T5b4Bacq+Pockv0uLi5zYLomHsPCZ9Re6s=; b=TQRHeb41MQC9yo7qO0n+t51NUvUOQrKDsUwO2lK9jSlSocr4vk/IheYUL84IT2ujgf3apoU1df0B+n5Ym0ZwMkh2/t/wStlJj1yToehmXkiDjcN/1iJGWl/Gg2odQhKoW9nP0KcTRNl1zS0LzgQuGedOSNSZnueC9o5fHof47fsJ0TtWIx9BdKSZQvlFlrFyTl3koLjOFShodxfB+pkI/1xDx4HtKwVJwuK40m8RhRrgWOtRuNxbbaxC3QOuOf7vwjPZJx/hCA7IY8RfoDKl5yCkss2tmD4QJmm8650+PVXfBw2Jvvb1d8HJtQC+ihHr1cV5E81WMuFxMbyWPgmdjA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snK38-0003cf-0W for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73046 X-GNU-PR-Package: emacs Original-Received: via spool by 73046-submit@debbugs.gnu.org id=B73046.172581009413883 (code B ref 73046); Sun, 08 Sep 2024 15:42:01 +0000 Original-Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:41:34 +0000 Original-Received: from localhost ([127.0.0.1]:59916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snK2g-0003bq-7L for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:41:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snK2d-0003bd-Kq for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:41:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snK2V-00056T-Ds; Sun, 08 Sep 2024 11:41:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AsJr0kdH1T5b4Bacq+Pockv0uLi5zYLomHsPCZ9Re6s=; b=S2XYpimWdmYq 5wsBMe7UQyCqnQZw98KFu7SdAQW4KbifALpGwwqLHON5jRvY6I+MZToFsGrscRtxBvU/0CGCdf3Z0 LD0ZmYeqojqE7/iOC2tWripyHcYz/s3/JiWPpBGi2sQcaz4aNateTIKmIKheSMVqIqBbaMH+d8rh3 Bg4LBg6QcC7GYpIjmnZ79mo9h2Npm+jq/qujnNsn0FTzfl25I/VM3VPKJEJhImaWUHHqSvvbZi+tf p7yJX407jY7Jgjfr5noc0wEUZo8JIs+rlvtAXrP7eW8hLYe7SDNpL3KdYEeqIC09l3YOgJ+SQiuYK Xnvwx5NZY30qrXK2osTx1A==; In-Reply-To: <87a5gigo9b.fsf@gmx.de> (message from Michael Albinus on Sun, 08 Sep 2024 17:26:40 +0200) 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:291464 Archived-At: > From: Michael Albinus > Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org > Date: Sun, 08 Sep 2024 17:26:40 +0200 > > Eli Zaretskii writes: > > >> Tramp is in a loop, waiting for results from the remote side. I don't > >> know how to implement this differently. > > > > What kind of loop? Can you point me to the code which loops there? > > The umbrella function is tramp-send-command. It sends the command to > remote via tramp-send-string, and waits then for a proper shell prompt > via tramp-wait-for-output. The latter function calls > tramp-wait-for-regexp, which loops using tramp-accept-process-output. Did you try either calling accept-process-output with a non-zero timeout of, say, 5 msec, or inserting a (sit-for 0.005) into the loop which calls tramp-accept-process-output? Waiting for a process to respond should try not to spin without sleeping for a few milliseconds between polling attempts.