unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: 35506@debbugs.gnu.org
Subject: bug#35506: Acknowledgement (27.0.50; Emacs hangs while interrupting tramp processes)
Date: Tue, 30 Apr 2019 13:28:24 -0400	[thread overview]
Message-ID: <87tvefz9l3.fsf@gmail.com> (raw)
In-Reply-To: <handler.35506.B.155664402325068.ack@debbugs.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]


Attached are the two patches I mentioned in the bug report.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Kill-the-entire-process-group.patch --]
[-- Type: text/x-patch, Size: 1019 bytes --]

From e056e98d4b899b8ae7636a967d0a55125e624fad Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
Date: Mon, 29 Apr 2019 16:09:32 -0400
Subject: [PATCH] Kill the entire process group

Some processes (e.g. terraform) don't handle signals but its
subprocess (with the exact same name) does.  Killing the parent
process doesn't do anything, we have to send the signal to the entire
group in order to reach the child.  This seems to be what terminals
typically do.
---
 lisp/net/tramp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 2e1a0960d7..427b3c41e3 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4870,7 +4870,7 @@ tramp-interrupt-process
 	(tramp-compat-funcall
 	 'tramp-send-command
 	 (process-get proc 'vector)
-	 (format "kill -2 %d" pid))
+	 (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))
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-Do-not-wait-for-process-output-after-interruption.patch --]
[-- Type: text/x-patch, Size: 1170 bytes --]

From cf2d0e2e58a683756878c9c7e4dd2066efe6e807 Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
Date: Mon, 29 Apr 2019 16:10:47 -0400
Subject: [PATCH] Do not wait for process output after interruption.

Some processes such as terraform can have cleanup logic that causes
the process to take longer to shut down than normal.  This causes
eshell to do a busy wait locking up Emacs while waiting for the
process to finish.  I don't understand why we do that anyway, just let
the process finish at its own pace.
---
 lisp/net/tramp.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 427b3c41e3..27bef45efb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4873,10 +4873,7 @@ 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)))))
+        ))))
 
 ;; `interrupt-process-functions' exists since Emacs 26.1.
 (when (boundp 'interrupt-process-functions)
-- 
2.21.0


  parent reply	other threads:[~2019-04-30 17:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 17:06 bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes John Shahid
     [not found] ` <handler.35506.B.155664402325068.ack@debbugs.gnu.org>
2019-04-30 17:28   ` John Shahid [this message]
2019-05-03  8:30 ` Michael Albinus
2019-05-04 14:33   ` John Shahid
2019-05-04 16:36     ` Michael Albinus
2019-05-04 17:44       ` John Shahid
2019-05-04 18:07         ` John Shahid
2019-05-14 18:19           ` Michael Albinus
2019-05-14 18:59             ` John Shahid
2019-05-15 14:32               ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvefz9l3.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=35506@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).