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: Re: Tramp timeout for currently unreachable connections? Date: Thu, 12 Sep 2024 22:44:18 +0530 Message-ID: <875xr06bh1.fsf@gmail.com> References: <87ed5p54dx.fsf@gmail.com> <877cbhj5dg.fsf@gmx.de> <87plp8lwo2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21679"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Albinus , help-gnu-emacs@gnu.org To: Robert Pluim Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 12 19:15:13 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 1sonPU-0005V1-Qt for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 12 Sep 2024 19:15:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sonOx-0004B6-JR; Thu, 12 Sep 2024 13:14:39 -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 1sonOv-00049u-LL for help-gnu-emacs@gnu.org; Thu, 12 Sep 2024 13:14:37 -0400 Original-Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sonOt-0002Wn-HK for help-gnu-emacs@gnu.org; Thu, 12 Sep 2024 13:14:36 -0400 Original-Received: by mail-pf1-x444.google.com with SMTP id d2e1a72fcca58-7191df6b5f5so947015b3a.0 for ; Thu, 12 Sep 2024 10:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726161274; x=1726766074; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8lD02SETmkXY7NTVKINffQ5MQFao4s6Uk81jXbh8Phg=; b=S95RfXkWDWYn2RaAv//TdbXEX3nZVj/vV/UrPCd75+nhsqiaKD5OOV66CquZuaUgOO fmc5bK83abzYlbENjh7nKwm9foz+qMkLpyKTbAVDhURIcsNYm746XoijhUk5K6IQGfGp 3BXn8l5AdsyWiUAQBEwb6ztUZLxB3fqc6ywj+I1mbwgu1eWMW/DISrSdBLe6VlzOkM01 oEQTOos0UxfWhW1GN8ZV3+Pjp4EydcjZ30Bj2CLl1pJn9+Wj7oR6I+wxQSpPqyzInKAp 5Cy+9BY5DB8daBZpBJn31wBtemi9Wg7Svk+IZ6OQV8Hxon0S1/GdWe/1WSqyXdCJER0+ nA8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726161274; x=1726766074; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8lD02SETmkXY7NTVKINffQ5MQFao4s6Uk81jXbh8Phg=; b=vsDqObYJBNl6qKvxxIwgww2GjRZlMM1kznLiRgJAFaAb/UFJJlzKJ7RCZJKF0MNWuM lyQr27a8frHCUbL6KpuByZ6GHKVdlI+UBC5Tt3fvisZqIAGWU0dTTGxatT2z2bzZj9KX YKLRyO6YnhYDl+IgSiqez3Z8D59alnL5EHzlGg/a/8syzkpCrL7AU299+prdGJbOvL5Z CCl2uQTh76BAyOq+cQmDuNPyttACgQ7r0FZLfyW7qcLiYpJWFFbDqTe1IKn7KPIRaex9 2SlUAEWQX/NVVS6x7r93EzcYUlXbRFtwN7uyzcPJhM5w8ebHPPmcOHuyTi1TkDtFxZfW X3mA== X-Forwarded-Encrypted: i=1; AJvYcCWCcXoWT0ayPLeY2xcGED5av9x7hXgVtexQmG1uBoYGqja2yEGv9UseaIm46WDNiPR4O36RZKCrSeQH7p+BHA==@gnu.org X-Gm-Message-State: AOJu0Ywgs/5m1HZeTa1oa/cdqnfJAcRwV1OV9AYdVeIEvhmRpabstCc4 wydBFw76ifHPPK6JJ6xmJvLpg9q7WEM10Zx2Ennnpv31zlBGaCHmHfMjUqSh X-Google-Smtp-Source: AGHT+IFYx9PjIqlEy/TO1zshfW0N66AiqsiWRo/pC4mrfGw+ByfVHH5bKbVFCvN12CUmwkOxrH1Ehw== X-Received: by 2002:a05:6a00:2196:b0:717:9768:a4f0 with SMTP id d2e1a72fcca58-71925f9d846mr5943333b3a.0.1726161273493; Thu, 12 Sep 2024 10:14:33 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71908fc8fa4sm4833609b3a.35.2024.09.12.10.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 10:14:33 -0700 (PDT) In-Reply-To: <87plp8lwo2.fsf@gmail.com> (Robert Pluim's message of "Thu, 12 Sep 2024 17:27:25 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=visuweshm@gmail.com; helo=mail-pf1-x444.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:147963 Archived-At: [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=9A= =E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0= =AF=8D 12, 2024] Robert Pluim wrote: >>>>>> On Thu, 12 Sep 2024 16:47:39 +0200, Michael Albinus said: > > Michael> Visuwesh writes: > >> Hello all, > > Michael> Hi Visuwesh, > > >> I know that non-essential=3Dt prevents Tramp from establishing new > >> connections but is there a way to make Tramp use a very short time= out > >> when trying to connect to a previously established connection that= is > >> now unreachable? What I mean is: if I am connected to a remote ho= st via > >> a ssh connection /ssh:user@remote: and my internet connection goes= down, > >> I do not want Tramp trying to fetch remote resources forever. > > Michael> Use 'M-x tramp-cleanup-connection'. Play with user option `t= ramp-connection-timeout'. > > Idle thought: would enabling 'ServerAliveInterval' help at all here? > (my Tramp connections travel from one side of my desk to the other, so > I can=CA=BCt tell =E2=98=BA=EF=B8=8F) I have it set to 100 but it doesn't help much. I don't think I am describing my problem well. I have the following function (defun vz/stb--buffer-annotation (buffer) (let ((case-fold-search nil)) (pcase (buffer-name buffer) ((rx bos (1+ anychar) "<" (+ (not ">")) ">") (let ((non-essential t)) (vz/with-when (buffer-file-name buffer) (abbreviate-file-name it))) ;; (let ((non-essential t)) ;; (vz/with-when (vz/file-visiting-buffer-p buffer) ;; (abbreviate-file-name it))) ) ((rx bos "*" (or "shell" "ssh") (? "-")) (let ((non-essential t)) (abbreviate-file-name (buffer-local-value 'default-director= y buffer)))) (_ (vz/buffer-annotation buffer))))) that returns an annotation string for my C-x b replacement. If Tramp already knows the connection is dead, non-essential=3Dt signals Tramp to not to bother to open a new connection. I would like a similar variable to make Tramp give up after a few seconds if it gets no reply from the remote server in the case of connections that are no longer reachable.