unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Tramp timeout for currently unreachable connections?
@ 2024-09-12 14:32 Visuwesh
  2024-09-12 14:47 ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Visuwesh @ 2024-09-12 14:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hello all,

I know that non-essential=t prevents Tramp from establishing new
connections but is there a way to make Tramp use a very short timeout
when trying to connect to a previously established connection that is
now unreachable?  What I mean is: if I am connected to a remote host via
a ssh connection /ssh:user@remote: and my internet connection goes down,
I do not want Tramp trying to fetch remote resources forever.  For
example, consider an abbreviate-file-name call when such a connection is
no longer reachable.  With M-x toggle-debug-on-quit,

    M-: (let ((non-essential t) (remote-file-name-access-timeout 1)) (abbreviate-file-name default-directory)) RET ... C-g

in a remote buffer yields the following backtrace:

Debugger entered--Lisp error: (quit "")
  signal(quit (""))
  tramp-signal-hook-function(quit nil)
  tramp-accept-process-output(#<process *tramp/ssh user@remote*>)
  tramp-wait-for-regexp(#<process *tramp/ssh user@remote*> nil "\\(?:^\\|\0\\)\\(?:[^\n#$]*///4a90d21f6648cee2bec7823f4b91fec3#\\$\\(?:\33\\[[0-?]*[ -/]*[@-~]\\)?\15?$\\)")
  tramp-wait-for-output(#<process *tramp/ssh user@remote*>)
  tramp-send-command((tramp-file-name "ssh" "user" nil "remote" nil "/home/user/tmp" nil) "test -e /home/user/tmp 2>/dev/null; echo tramp_exit_status $?")
  tramp-send-command-and-check((tramp-file-name "ssh" "user" nil "remote" nil "/home/user/tmp" nil) "test -e /home/user/tmp")
  tramp-sh-handle-file-exists-p("/ssh:user@remote:/home/user/tmp")
  apply(tramp-sh-handle-file-exists-p "/ssh:user@remote:/home/user/tmp")
  tramp-sh-file-name-handler(file-exists-p "/ssh:user@remote:/home/user/tmp")
  apply(tramp-sh-file-name-handler file-exists-p "/ssh:user@remote:/home/user/tmp")
  tramp-file-name-handler(file-exists-p "/ssh:user@remote:/home/user/tmp")
  file-exists-p("/ssh:user@remote:/home/user/tmp")
  tramp-handle-file-name-case-insensitive-p("/ssh:user@remote:/home/user/tmp/")
  apply(tramp-handle-file-name-case-insensitive-p "/ssh:user@remote:/home/user/tmp/")
  tramp-sh-file-name-handler(file-name-case-insensitive-p "/ssh:user@remote:/home/user/tmp/")
  apply(tramp-sh-file-name-handler file-name-case-insensitive-p "/ssh:user@remote:/home/user/tmp/")
  tramp-file-name-handler(file-name-case-insensitive-p "/ssh:user@remote:/home/user/tmp/")
  file-name-case-insensitive-p("/ssh:user@remote:/home/user/tmp/")
  tramp-handle-abbreviate-file-name("/ssh:user@remote:/home/user/tmp/")
  apply(tramp-handle-abbreviate-file-name "/ssh:user@remote:/home/user/tmp/")
  tramp-sh-file-name-handler(abbreviate-file-name "/ssh:user@remote:/home/user/tmp/")
  apply(tramp-sh-file-name-handler abbreviate-file-name "/ssh:user@remote:/home/user/tmp/")
  tramp-file-name-handler(abbreviate-file-name "/ssh:user@remote:/home/user/tmp/")
  abbreviate-file-name("/ssh:user@remote:/home/user/tmp/")
  (let ((non-essential t) (remote-file-name-access-timeout 1)) (abbreviate-file-name default-directory))
  eval((let ((non-essential t) (remote-file-name-access-timeout 1)) (abbreviate-file-name default-directory)) t)
  #f(compiled-function () #<bytecode -0x93fec5cef4eacc6>)()
  #f(compiled-function () #<bytecode -0x5db3e1955cb81d1>)()
  handler-bind-1(#f(compiled-function () #<bytecode -0x5db3e1955cb81d1>) (error) eval-expression--debug)
  eval-expression((let ((non-essential t) (remote-file-name-access-timeout 1)) (abbreviate-file-name default-directory)) nil nil 127)
  funcall-interactively(eval-expression (let ((non-essential t) (remote-file-name-access-timeout 1)) (abbreviate-file-name default-directory)) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

I would like to know if it is possible to make Tramp send non-nil
TIMEOUT argument to tramp-wait-for-output (maybe even higher up the
call chain).  I know of without-remote-files but is there a less heavier
hammer? Because I do _want_ Tramp to do its job when the connection is
still reachable.

Thank you.

P.S. Kindly keep me CC'd since I do not follow this list.



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

end of thread, other threads:[~2024-09-12 17:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 14:32 Tramp timeout for currently unreachable connections? Visuwesh
2024-09-12 14:47 ` Michael Albinus
2024-09-12 15:24   ` Visuwesh
2024-09-12 17:27     ` Michael Albinus
2024-09-12 15:27   ` Robert Pluim
2024-09-12 17:14     ` Visuwesh
2024-09-12 17:37       ` Michael Albinus
2024-09-12 17:45         ` Visuwesh
2024-09-12 17:22     ` Michael Albinus
2024-09-12 17:35       ` Visuwesh

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