Subject: Re: bug#78572: 30.1; Tramp Project error message loop - File is missing

From: Dmitry Gutov <[email-masked]>
Date: Fri, 30 May 2025 04:03:18 +0300

Hi Michael,

On 27/05/2025 21:58, Michael Albinus wrote:

> --8<---------------cut here---------------start------------->8---
> ;; Emacs: 30.1.90 Tramp: 2.7.3.30.2 -*- mode: outline; coding: utf-8; -*-
> ;; Location: /home/albinus/src/emacs-30/lisp/net/tramp.elc Git: emacs-30/d0c90bc9bfe8fedbff7f282086dc38458b1e0f9e
> 13:04:06.892642 tramp-get-connection-property (7) # ~root undef; cache used: nil
> --8<---------------cut here---------------end--------------->8---
> 
> This is where it starts.
> 
> --8<---------------cut here---------------start------------->8---
> ...
> (".local/" "/root/.local" t t t)
> ("tmp/" "/root/tmp" t t t)
> )
> tramp_exit_status 0
> ///701580ff750d89979a541cae0f26aa39#$
> --8<---------------cut here---------------end--------------->8---
> 
> The last command before the session timeout. Emacs is still busy,
> because the project-mode-line-format must be refreshed again and
> again. But these information are taken from Tramp's cache; no activity
> on the wire.

The fact that it's refreshed often is something that can be improved in 
project.el with better caching. But it seems like the minor of the 
issues here.

> Tramp needs to know, whether "/sudo:root@ubuntu-2404:/root" is a
> directory. It asks the cache (first line), but this doesn't have the
> information (it returns undef). So Tramp must go on wire in order to
> compute the information. But his fails as well ("Non-essential received
> in operation..."), resulting in an error. Why this? Hmm, in
> project-current, non-essential is bound to t, telling Tramp it should
> *not* establish a new connection. This is an optimization I believe, see
> bug#69584. And here we are.

Indeed it is. With non-essential not bound, we could have Emacs freezing 
for like 0.5-2 (depending on the remote host) seconds every five minutes 
- not great either. So, not sure what's the ideal approach here. Longer 
caching might improve some things, but any freeze (5, 10 or 30 minutes 
later) seems problematic.

I think we also missed the first part of the original description - the 
"File is missing" errors being echoed. Should that happen? Does that 
occur due to missing permissions and/or because tramp-verbose is set to 10?