From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 29735@debbugs.gnu.org
Subject: bug#29735: 27.0.50; It must be possible to suspend all timers
Date: Tue, 19 Dec 2017 19:47:08 +0100 [thread overview]
Message-ID: <87y3lya72r.fsf@gmx.de> (raw)
In-Reply-To: <jwvzi6eag5f.fsf-monnier+bug#29735@gnu.org> (Stefan Monnier's message of "Tue, 19 Dec 2017 10:58:40 -0500")
Stefan Monnier <monnier@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.
prev parent reply other threads:[~2017-12-19 18:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-16 15:31 bug#29735: 27.0.50; It must be possible to suspend all timers Michael Albinus
2017-12-16 16:22 ` Eli Zaretskii
2017-12-17 9:08 ` Michael Albinus
2017-12-17 15:24 ` Eli Zaretskii
2017-12-17 18:43 ` Michael Albinus
2017-12-19 15:58 ` Stefan Monnier
2017-12-19 18:47 ` Michael Albinus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3lya72r.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=29735@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.