[Top][All Lists]

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

Re: `Compile' hang on remote files, not sure if it is a concurrent race

From: Michael Albinus
Subject: Re: `Compile' hang on remote files, not sure if it is a concurrent race issue
Date: Sun, 31 May 2020 17:19:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Fan Yang <> writes:

Hi Fan,

>> What happens, if you open a shell on your remote vm01 host, and raise
>> the command
>> # \readlink --canonicalize-missing /usr/src/kernels/5.3.7-301.fc31.x86_64
> It prints out "/usr/src/kernels/5.3.7-301.fc31.x86_64”.

That's OK. So there's no problem with this particular command.

>> I haven't seen such race conflicts so far. In general, Tramp shall be
>> able to handle concurrent (asynchronous) processes.
> I think Tramp use a “*tramp/method host*” buffer to receive the output
> from the remote side.  What would happen if multiple asynchronous
> process (in my case, the compile process and the readlink process)
> send output to this buffer at the same time?  Is there some
> "mutex"-like thing to prevent this?

The *tramp/method host* buffer is used only for synchronous
processes. There can be only one synchronous (sub)process of Emacs at a
given time, so there's no problem.

compile.el uses asynchronous processes. Every such a process has an own
buffer, so they can run kind of asynchronously. Of course there's only
one process at a given time which is running; switching happens when
they wait for output.

> If you will, could you elaborate a little about how Tramp handles
> concurrent access to the same connection?

It has an own implementation of start-file-process and make-process. See
the code.

>> You could try to set tramp-verbose to 6, and rerun your test. Maybe we
>> see something in the traces, but it would be hard if there are many data.
> I tried, unfortunately the message only shows the following:
> Tramp: Opening connection for vm01 using ssh...
> Tramp: Sending command ‘exec ssh -q -o ControlMaster=auto -o
> ControlPath='tramp.%C' -o ControlPersist=no -e none vm01’
> Tramp: Waiting for prompts from remote shell...done
> Tramp: Found remote shell prompt on ‘vm01’
> Tramp: Opening connection for vm01 using ssh...done
> Entering debugger...
> "Entering debugger..." is print after I observed hang and 
> "pkill -SIGUSR2 Emacs”.

That's not the interesting part. When you have increased tramp-verbose
as indicated, there will be a debug buffer *debug tramp/method host*.
That's what we need to analyze.

> For me, this bug is so hard to debug since they are async and
> concurrent:(  Do you have some advice for me to further look into
> this?

Nothing but reading the debug buffer.

> Best regards,
> Fan

Best regards, Michael.

reply via email to

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