GNU bug report logs - #29735
27.0.50; It must be possible to suspend all timers

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Sat, 16 Dec 2017 15:32:02 UTC

Severity: wishlist

Found in version 27.0.50

Full log


Message #25 received at 29735 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 29735 <at> debbugs.gnu.org
Subject: Re: bug#29735: 27.0.50; It must be possible to suspend all timers
Date: Tue, 19 Dec 2017 19:47:08 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

Hi Stefan,

>> If during that time a timer starts, which wants to apply a regular file
>> operation (let's say `file-attributes'), the corresponding commands are
>> sent to the process related to the just started asynchronous process,
>> instead to the working horse *tramp/method host*. This fails, of
>> course. Therefore, the start of timers between the both code samples
>> must be suppressed.
>
> Hmm... but IIUC the same problem shows up if some random process-filter
> or process-sentinel uses, say, file-attributes on that same host, right?
> So it's not specific to timers?

In theory, yes. But I haven't seen it yet. During the initialization
process of Tramp's asynchronous processes, in
`tramp-sh-handle-start-file-process', no process-sentinel or
process-filter shall run. Tramp itself tries to avoid this, by calling
(accept-process-output proc timeout nil 0)
See `tramp-accept-process-output'.

The other situations process output could arrive are `sit-for' and
`sleep-for'. I'm not aware that these functions are called inside the
process initialization of `tramp-sh-handle-start-file-process'.

> From the description you give, I understand that:
> - start-file-process causes the creation of a new underlying ssh process
>   (that makes sense).

yes

> - so from then on, we have 2 (or more) ssh processes on the same host
>   and the issue is to know which process to use when.

yes

> So the problem is to somehow get the "context" of a given call to Tramp,
> so as to know which process to use.
> Do I understand correctly?

yes

> Currently you store which process to use as a "connection-property"
> (and it defaults to the "main" process), so basically the "context" is
> store in a kind of global variable.

yes

> Would it make sense to try and pass that "context" information as
> additional arguments instead?  Or via dynamically-coped variable?
>
> E.g. any call to file-attributes (or any other file-name-operation)
> should always use the main process, right?  So the mapping from
> connection->process could be stored in a dynamically-scoped var, and
> tramp-file-name-handler could let-bind this var to nil?

That's exactly what I've tried prior the current implementation.
`tramp-file-name-handler' is the main door all file name handler
operations must pass. Inside this, I've stored the setting of the
process connection-property somewhere, and I've set it to the "main
process". After the respective handler function returned, I've restored
the process connection property to its saved value.

Unfortunately, this is not sufficient. I've still seen errors in
`tramp-test41-asynchronous-requests' from time to time. And as I said
already, it is almost impossible to debug this. It happens rarely only,
and debugging changes time conditions.

>         Stefan

Best regards, Michael.




This bug report was last modified 7 years and 269 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.