Re: Default connection timeout for the sudo method

Michael Albinus <[email protected]> Sun, 17 Aug 2025 11:34:05 +0200
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
"R. Diez" <[email protected]> writes:

Hi,

>> I've checked the Tramp manual. It speaks about the 5 minutes session
>> timeout in (info "(tramp) Inline methods") , item =E2=80=98sudo=E2=80=99.
>
> OK, thanks. I missed it because, if you search the Internet for "tramp co=
nnection timeout", you tend to land on this page:

Words matter. Tramp distincts between "connection timeout" (a failure,
when initial hand-shaking fails), and "seesion timeout" (a sudo or alike
Tramp connection, which is closed after a while due to security
concerns).

> https://www.gnu.org/software/emacs/manual/html_node/tramp/Predefined-conn=
ection-information.html
>
> That page states:
>
> -------8<-------8<-------8<-------
> "session-timeout"
>
> All tramp-sh.el based methods accept the property
> "session-timeout". This is the time (in seconds) after a connection is
> disabled for security reasons, and must be reestablished. A value of
> nil disables this feature. Most of the methods do not set this
> property except the sudo, doas and run0 methods, which use predefined
> values.
> -------8<-------8<-------8<-------
>
> It does not say "which use the predefined values documented in the Inline=
 Methods section", and you wouldn't normally think of searching further in =
the documentation.
>
> While you do have a point, that the documentation does include that piece=
 of information, I would add a reference, or duplicate the information, rig=
ht at the point where the user would expect to find it.

Well, this section explains it in its beginning: Look at tramp-methods.

>>> Its value is (("/sshfs:" "direct-async-process" t))
>>> Original value was nil
>> This is a deprecated setting in Tramp 2.7. Pls ignore; it doesn't
>> harm.
>
> OK, thanks for the hint.
>
> I actually have Tramp 2.8.0.1 installed on Emacs 29. If that setting was =
deprecated in Tramp 2.7, is there a reason why it is still there?

Don't know. Likely, a leftover when you have switched from Tramp 2.7 to
2.8. Again, it doesn't hurt!

>>> If I do customize-variable, tramp-connection-properties, then it states=
 "CHANGED outside Customize".
>> Yes, due to the setting in Tramp.
>
> Is that the right behaviour? If that is a user-customisable setting, and =
I haven't set it in my init code, it shouldn't say "CHANGED outside Customi=
ze", should it?
>
> Or am I missing something? I am not actually an Emacs expert by any means.

Well, this effect has been reported already here in the tramp-devel
ML. It's waiting to be analyzed.

>>> Note also the wrong new-line character after "=E2=80=98killed".
>> This comes from the process sentinel, nothing relevant for
>> Tramp. Ignore it.
>
> I would sanitise such external messages before writing them to the log, s=
o that they do not break the log format. In the past, I have converted non-=
printable characters to \t or \n to that effect.
>
> But it is a minor point indeed.

Tramp does not touch any message coming from an external process. It is
important to localize what happened there, and oftern I cannot reproduce
the reported problem due to difgferences in the environment. Proper
debug messages are the only help.

> Best regards,
>   rdiez

Best regards, Michael.