bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes


From: John Shahid
Subject: bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes
Date: Tue, 14 May 2019 14:59:08 -0400
User-agent: mu4e 1.1.0; emacs 27.0.50

Michael Albinus <michael.albinus@gmx.de> writes:

> John Shahid <jvshahid@gmail.com> writes:
>
> Hi John,
>
>>> I will test it out tomorrow morning.  I still prefer not waiting at all.
>>> I am not sure if the 1 second wait will be noticeable or not, but we
>>> wouldn't know until I try it out.
>>
>> I just tried that patch and it fixed the issue.  The 1 second timeout
>> isn't noticeable at all.  I'm happy to create a patch and attach it to
>> the bug report.
>
> Could it be that we're waiting on each other? Do you plan to contribute
> a patch, or shall I do?

Indeed.  I went ahead and created the patch.

>From 418048bb52188a747acab6349a71c42c4ceebe2b Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
Date: Mon, 29 Apr 2019 16:10:47 -0400
Subject: [PATCH] Avoid infinitly looping in tramp-interrupt-process

* lisp/net/tramp.el (tramp-interrupt-process): Remove with-timeout.
Instead pass a timeout to tramp-accept-process-output.
tramp-accept-process-output stops timers from running which makes the
with-timeout ineffective.
---
 lisp/net/tramp.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0a3129fd45..2aa62eba80 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4861,10 +4861,9 @@ tramp-interrupt-process
         (format "kill -2 -%d" pid))
        ;; Wait, until the process has disappeared.  If it doesn't,
        ;; fall back to the default implementation.
-       (with-timeout (1 (ignore))
-         (while (tramp-accept-process-output proc))
-         ;; Report success.
-         proc)))))
+        (and (tramp-accept-process-output proc 1)
+            ;; Report success.
+            proc)))))
 
 ;; `interrupt-process-functions' exists since Emacs 26.1.
 (when (boundp 'interrupt-process-functions)
-- 
2.21.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]