From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#8929: 24.0.50; tramp hangs when process died Date: Fri, 01 Jul 2011 14:59:06 +0200 Message-ID: <87d3hu40o5.fsf@gmx.de> References: <87tybf4b6l.fsf@ubik.of1par.int.rtblw.com> <87oc1l7zbp.fsf@gmx.de> <87r56fwt17.fsf@ubik.of1par.int.rtblw.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309525414 9283 80.91.229.12 (1 Jul 2011 13:03:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 13:03:34 +0000 (UTC) Cc: 8929@debbugs.gnu.org To: =?UTF-8?Q?S=C3=A9bastien?= Gross Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 01 15:03:26 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcdNV-00062n-2v for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jul 2011 15:03:25 +0200 Original-Received: from localhost ([::1]:40667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdNU-0004SA-23 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jul 2011 09:03:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdKK-0003ig-H7 for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2011 09:00:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcdKI-0004aM-6t for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2011 09:00:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdKH-0004aA-Uv for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2011 09:00:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QcdKG-0000xZ-G9; Fri, 01 Jul 2011 09:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jul 2011 13:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8929-submit@debbugs.gnu.org id=B8929.13095251653588 (code B ref 8929); Fri, 01 Jul 2011 13:00:03 +0000 Original-Received: (at 8929) by debbugs.gnu.org; 1 Jul 2011 12:59:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QcdJc-0000vp-JT for submit@debbugs.gnu.org; Fri, 01 Jul 2011 08:59:24 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QcdJZ-0000vc-Rz for 8929@debbugs.gnu.org; Fri, 01 Jul 2011 08:59:22 -0400 Original-Received: (qmail invoked by alias); 01 Jul 2011 12:59:15 -0000 Original-Received: from p57BB965A.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.90] by mail.gmx.net (mp045) with SMTP; 01 Jul 2011 14:59:15 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1++xoNtHuO+dnirb8c9V7NLU9a9SYB8SHuJbDDZau 7LuzxQJNtTP0fW In-Reply-To: <87r56fwt17.fsf@ubik.of1par.int.rtblw.com> ("=?UTF-8?Q?S=C3=A9bastien?= Gross"'s message of "Mon, 27 Jun 2011 10:57:40 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 01 Jul 2011 09:00:04 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47695 Archived-At: S=C3=A9bastien Gross writes: > Hi, Hi S=C3=A9bastien, >> 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.000000= 000 +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 ""))))) =20=20 ;; 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)))))) =20=20 (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) =20=20 ;; 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) =20=20 --- 4299,4313 ---- tramp-encoding-command-interactive) (list tramp-encoding-shell)))))) =20=20 + ;; 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) +=20 (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) =20=20 ;; Check whether process is alive. (tramp-barf-if-no-shell-prompt p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell) =20=20 --8<---------------cut here---------------end--------------->8--- > Cheers, Best regards, Michael.