From: Michael Albinus <michael.albinus@gmx.de>
To: "Sébastien Gross" <seb@chezwam.org>
Cc: 8929@debbugs.gnu.org
Subject: bug#8929: 24.0.50; tramp hangs when process died
Date: Fri, 01 Jul 2011 14:59:06 +0200 [thread overview]
Message-ID: <87d3hu40o5.fsf@gmx.de> (raw)
In-Reply-To: <87r56fwt17.fsf@ubik.of1par.int.rtblw.com> ("Sébastien Gross"'s message of "Mon, 27 Jun 2011 10:57:40 +0200")
Sébastien Gross <seb@chezwam.org> writes:
> Hi,
Hi Sébastien,
>> I wouldn't like to add such a radical buffer kill. Asynchronous
>> processes on remote hosts would loose their output buffer, when they
>> have finished. Debugging of Tramp problems would be harder.
>
> I do totally agree with you about the debugging purposes.
I've checked the code: we have already a sentinel, which adds some
cleanup in case a process died. But this is applied only for
asynchronous processes.
I've extended the sentinel a little bit, and I've moved the sentinel
setup to `tramp-maybe-open-connection'. It is activated for all
processes now.
Could you, please, check the patch, whether it is sufficient to your needs?
--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp-sh.el.~1~ 2011-07-01 11:25:11.000000000 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el 2011-07-01 14:35:41.304448000 +0200
***************
*** 2669,2674 ****
--- 2669,2675 ----
(let ((vec (tramp-get-connection-property proc "vector" nil)))
(when vec
(tramp-message vec 5 "Sentinel called: `%s' `%s'" proc event)
+ (tramp-flush-connection-property proc)
(tramp-flush-directory-property vec "")))))
;; We use BUFFER also as connection buffer during setup. Because of
***************
*** 2721,2729 ****
v 'file-error
"pty association is not supported for `%s'" name)))))
(let ((p (tramp-get-connection-process v)))
! ;; Set sentinel and query flag for this process.
! (tramp-set-connection-property p "vector" v)
! (set-process-sentinel p 'tramp-process-sentinel)
(tramp-compat-set-process-query-on-exit-flag p t)
;; Return process.
p)))
--- 2722,2728 ----
v 'file-error
"pty association is not supported for `%s'" name)))))
(let ((p (tramp-get-connection-process v)))
! ;; Set query flag for this process.
(tramp-compat-set-process-query-on-exit-flag p t)
;; Return process.
p)))
***************
*** 4300,4310 ****
tramp-encoding-command-interactive)
(list tramp-encoding-shell))))))
(tramp-message
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
;; Check whether process is alive.
- (tramp-compat-set-process-query-on-exit-flag p nil)
(tramp-barf-if-no-shell-prompt
p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
--- 4299,4313 ----
tramp-encoding-command-interactive)
(list tramp-encoding-shell))))))
+ ;; Set sentinel and query flag.
+ (tramp-set-connection-property p "vector" vec)
+ (set-process-sentinel p 'tramp-process-sentinel)
+ (tramp-compat-set-process-query-on-exit-flag p nil)
+
(tramp-message
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
;; Check whether process is alive.
(tramp-barf-if-no-shell-prompt
p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
--8<---------------cut here---------------end--------------->8---
> Cheers,
Best regards, Michael.
next prev parent reply other threads:[~2011-07-01 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=87d3hu40o5.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=8929@debbugs.gnu.org \
--cc=seb@chezwam.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.