]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid 100% CPU load in Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 10 Sep 2024 08:04:01 +0000 (10:04 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 14 Sep 2024 20:20:34 +0000 (22:20 +0200)
* lisp/net/tramp.el (tramp-wait-for-regexp): Add (sit-for 0.005)
prior calling `tramp-accept-process-output'.  This avoids 100% CPU
load.  (Bug#73046)

(cherry picked from commit 652a8a0838b38a6eab85c55fc61cedd1c61ef20f)

lisp/net/tramp.el

index 9efd547624274ca26da0c3ab0fc1da1e23231aba..ad2587fb597469e6f231eebb10931aeaab172c21 100644 (file)
@@ -6029,6 +6029,8 @@ nil."
   (let ((found (tramp-check-for-regexp proc regexp)))
     (with-tramp-timeout (timeout)
       (while (not found)
+       ;; This is needed to yield the CPU, otherwise we'll see 100% CPU load.
+       (sit-for 0.005)
        (tramp-accept-process-output proc)
        (unless (process-live-p proc)
          (tramp-error-with-buffer