[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 7f51ab5 2/2: Do not delete asynchronous Tramp processes due to se
From: |
Michael Albinus |
Subject: |
master 7f51ab5 2/2: Do not delete asynchronous Tramp processes due to session timeout |
Date: |
Sun, 3 May 2020 08:00:01 -0400 (EDT) |
branch: master
commit 7f51ab5163635aa6bc369b5173af955c6a27f927
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
Do not delete asynchronous Tramp processes due to session timeout
* lisp/net/tramp-cmds.el (tramp-cleanup-connection): New optional
argument KEEP-PROCESSES.
* lisp/net/tramp-sh.el (tramp-timeout-session): Use it. (Bug#41042)
---
lisp/net/tramp-cmds.el | 12 ++++++++----
lisp/net/tramp-sh.el | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 7d353e2..1742da8 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -74,11 +74,13 @@ SYNTAX can be one of the symbols `default' (default),
Each function is called with the current vector as argument.")
;;;###tramp-autoload
-(defun tramp-cleanup-connection (vec &optional keep-debug keep-password)
+(defun tramp-cleanup-connection
+ (vec &optional keep-debug keep-password keep-processes)
"Flush all connection related objects.
This includes password cache, file cache, connection cache,
-buffers. KEEP-DEBUG non-nil preserves the debug buffer.
-KEEP-PASSWORD non-nil preserves the password cache.
+buffers, processes. KEEP-DEBUG non-nil preserves the debug
+buffer. KEEP-PASSWORD non-nil preserves the password cache.
+KEEP-PROCESSES non-nil preserves the asynchronous processes.
When called interactively, a Tramp connection has to be selected."
(interactive
;; When interactive, select the Tramp remote identification.
@@ -116,7 +118,9 @@ When called interactively, a Tramp connection has to be
selected."
;; Delete processes.
(dolist (key (hash-table-keys tramp-cache-data))
(when (and (processp key)
- (tramp-file-name-equal-p (process-get key 'vector) vec))
+ (tramp-file-name-equal-p (process-get key 'vector) vec)
+ (or (not keep-processes)
+ (eq key (tramp-get-process vec))))
(tramp-flush-connection-properties key)
(delete-process key)))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a39d503..21ef1ef 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4915,7 +4915,7 @@ If there is just some editing, retry it after 5 seconds."
(run-at-time 5 nil 'tramp-timeout-session vec))
(tramp-message
vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'noloc))
- (tramp-cleanup-connection vec 'keep-debug)))
+ (tramp-cleanup-connection vec 'keep-debug nil 'keep-processes)))
(defun tramp-maybe-open-connection (vec)
"Maybe open a connection VEC.