Subject: Re: bug#49954: 28.0.50; TRAMP: cannot kill child processes: "Forbidden reentrant call of Tramp"

From: Dima Kogan <[email-masked]>
Date: Sat, 11 Sep 2021 01:32:27 -0700

Hi Michael.

So I've seen this a number of times now, and it really looks like the
caching mechanism is the problem. Every time I see "Forbidden reentrant
call of Tramp" when trying to C-c C-c a remote process, I re-evaluate
tramp-get-connection-property with

  (when (and (not (eq cached tramp-cache-undefined))
             ;; If the key is an auxiliary process object, check
             ;; whether the process is still alive.
             (not (and (processp key) (not (process-live-p key)))))
    (setq value cached
          cache-used t))

removed. This effectively disables the caching mechanism. Then I can C-c
C-c my process, and it dies like it's supposed to. TRAMP feels slower
after than, as expected, so I put tramp-get-connection-property back to
what it was. Eventually the problem comes back, and I do the same dance
to "fix" it.