unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8929: 24.0.50; tramp hangs when process died
@ 2011-06-24 13:21 Sébastien Gross
  2011-06-26  8:48 ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Gross @ 2011-06-24 13:21 UTC (permalink / raw)
  To: 8929


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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-07 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24 13:21 bug#8929: 24.0.50; tramp hangs when process died Sébastien Gross
2011-06-26  8:48 ` 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

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).