tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to avoid the user triggering "Forbidden reentrant call of Tramp"?


From: Hendrik Tews
Subject: How to avoid the user triggering "Forbidden reentrant call of Tramp"?
Date: Sun, 11 Apr 2021 23:30:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

in the application that I outlined in my previous email "optimize
tramp for many start-file-process'es in parallel", Tramp
functionality is invoked asynchronously from within a process
sentinel. The functionality has been purposely moved into
sentinels in order to keep Emacs responsive during the background
compilation, similarly to M-x compile. However, when the user
tries to open another file, maybe using completion, he possibly
invokes Tramp while another synchronous Tramp call (maybe
file-attributes), started from within some sentinel, is running.
Consequently the "Forbidden reentrant call of Tramp" error is
raised.

How should I design my sentinel, such that this error is avoided?
The source code hints to "connection buffers". How do I call
file-attributes, such that it uses one connection buffer, while
the user is doing file name completion, using a different
connection buffer?

BTW, thanks for introducing this error protection. When I started
with Tramp 2.4, it took quite some debugging until I found out
why file-attributes sometimes returned nonsense - the reason were
several interleaved calls, apparently using the same Tramp
internal data structures.

Thanks in advance,

Hendrik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]