From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.help Subject: Tramp timeout for currently unreachable connections? Date: Thu, 12 Sep 2024 20:02:42 +0530 Message-ID: <87ed5p54dx.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20784"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 12 16:33:38 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sokt7-0005Jq-8U for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 12 Sep 2024 16:33:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soksR-0003kP-Ru; Thu, 12 Sep 2024 10:32:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soksO-0003jo-Qi for help-gnu-emacs@gnu.org; Thu, 12 Sep 2024 10:32:53 -0400 Original-Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soksL-0006GQ-J9 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2024 10:32:51 -0400 Original-Received: by mail-pf1-x441.google.com with SMTP id d2e1a72fcca58-718e9c8bd83so1558590b3a.1 for ; Thu, 12 Sep 2024 07:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726151567; x=1726756367; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=USt44E+ojV8wgOxD651Z7xnrlYD9FFzjw8O7tH3S7u8=; b=lGBT948KaLqoMXWNtozfibbXOBZzh3i+61eoVjOuLCfOs6nLpFtqfi/XKuf6NjeMDa 8WK//U/9UUnYi58V+Ro7h75kzf9S8YyElyxmUru4D8teX+fTC78FXIuPw7NaHEve+xHI bCYfZD8nXSnFHlr8HIpqRtAI5xrtn58OIUGTu2gyobA02suwyG4GQx78C+BbnjhGIHX8 f0J3YmPHFWB1fvorlTzkXMbcEcMRJQQ69u+TpdZ5HWUkWuxS3R3Mnl/0iIbQ8DmSQc4E +Ly29YfGTWdUaQvYydOCaF47edAay5zVZMbjEJs2qDG2mDfRmpxcvGJol4YtDyzqphEf eC7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726151567; x=1726756367; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=USt44E+ojV8wgOxD651Z7xnrlYD9FFzjw8O7tH3S7u8=; b=DEOLC/oE6A0Y64NnS1SOz3NNf2EnnEo8Q1g2204TN/py2/662kyA7DfTQK+7GrqQSH osfQnGvhuFYieD5kkHnLEffeLsWT9Ky8dffvn8JolC3jihoWIDaxZv1c5/v1Djijid3f 8npnkVP2ajiRfjO7DtfY1IT7xfgbS1AjQA+p1ZKayu1R6X6ISWl8l2d4mtf6GdQhRbuj V8E40NpLP1XIxSC3c2oCD9bXFunWGm7K+h/GLDqBZ+MtDyBbHiwZrCRv7BsmqcwAapSt g3BRQVKcM7rIMmGlHf3IJPOSBfLafu1rFrobf3a4iSrpRhpzI3tuUCQFQH4XvNvgK/fi gb5Q== X-Gm-Message-State: AOJu0Yw9JKweHd2R4i2r0MOG82IYDc1sO1JpAA4YlDHjxaVSXdObMOvS d8h7ZyvAxyoWVn4a4SDl1XdyOtce6gwiPfVKWIhivc0JdxeiJ3IICnumJubu X-Google-Smtp-Source: AGHT+IHvI0Q5qs6KT4pPtmAroHlYsuAxrjhCb86pmAXknuunpKhmT0P55+E7ozMoWrwPTVNZk4KWQA== X-Received: by 2002:a05:6a20:3d86:b0:1ce:d403:612d with SMTP id adf61e73a8af0-1cf5e1441c0mr13124951637.13.1726151567040; Thu, 12 Sep 2024 07:32:47 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db1fddce76sm1759199a12.66.2024.09.12.07.32.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 07:32:46 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=visuweshm@gmail.com; helo=mail-pf1-x441.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147959 Archived-At: 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(#) tramp-wait-for-regexp(# nil "\\(?:^\\|\0\\)\\(?:[^\n#$]*///4a90d21f6648cee2bec7823f4b91fec3#\\$\\(?:\33\\[[0-?]*[ -/]*[@-~]\\)?\15?$\\)") tramp-wait-for-output(#) 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 () #)() #f(compiled-function () #)() handler-bind-1(#f(compiled-function () #) (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.