bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8929: 24.0.50; tramp hangs when process died


From: Michael Albinus
Subject: bug#8929: 24.0.50; tramp hangs when process died
Date: Fri, 01 Jul 2011 14:59:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]