all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sébastien Gross" <seb@chezwam.org>
To: 8929@debbugs.gnu.org
Subject: bug#8929: 24.0.50; tramp hangs when process died
Date: Fri, 24 Jun 2011 15:21:38 +0200	[thread overview]
Message-ID: <87tybf4b6l.fsf@ubik.of1par.int.rtblw.com> (raw)


Hi,

Using tramp to edit remote files creates some ssh processes.

When this process dies for some reasons (such ad IP change or network
outrage), the associated buffer is still alive and makes tramp hanging
when trying to reconnect the remote host.

This behavior happens every time I carry my laptop (in suspend to disk
or suspend to ram mode) from my home to my office (or the way back).


Here is a patch (for tramp-sh.el) to add a sentinel that kills the
process buffer when the process exit:

--- tramp-sh.el.o	2011-06-24 14:44:09.023169775 +0200
+++ tramp-sh.el	2011-06-24 14:52:57.383172776 +0200
@@ -4277,6 +4277,13 @@
 		       (tramp-get-connection-buffer vec)
 		       tramp-encoding-shell))))
 
+	    ;; Kill buffer when process died.
+	    (set-process-sentinel
+	     p
+	     (lambda (proc change)
+	       (when (eq (process-status proc) 'exit)
+		 (kill-buffer (process-buffer proc)))
+
 	    (tramp-message
 	     vec 6 "%s" (mapconcat 'identity (process-command p) " "))


Hope this doesn't break anything.

Cheers.



In GNU Emacs 24.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2011-05-23 on builder1-tc2ams, modified by Debian
 (emacs-snapshot package, version 1:20110520-1+squeeze)
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.50/site-lisp:/usr/share/emacs/site-lisp' '--without-compress-info' '--with-x=yes' '--with-x-toolkit=gtk' '--with-imagemagick=yes' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

-- 
Sébastien Gross





             reply	other threads:[~2011-06-24 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 13:21 Sébastien Gross [this message]
2011-06-26  8:48 ` bug#8929: 24.0.50; tramp hangs when process died Michael Albinus
2011-06-27  8:57   ` Sébastien Gross
2011-07-01 12:59     ` Michael Albinus
2011-07-07 13:24       ` Michael Albinus
     [not found]         ` <87wrfu9kkd.fsf@ubik.of1par.int.rtblw.com>
2011-07-07 15:52           ` 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

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

  git send-email \
    --in-reply-to=87tybf4b6l.fsf@ubik.of1par.int.rtblw.com \
    --to=seb@chezwam.org \
    --cc=8929@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.