unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: emacs-devel@gnu.org
Subject: Tramp and timers
Date: Fri, 11 Dec 2020 17:58:29 +0100	[thread overview]
Message-ID: <87ft4c5lfu.fsf@gmx.de> (raw)

Hi,

Tramp is plagued since ever with timers, which run while Tramp is
performing accept-process-output. If such a timer runs an operation
which includes also a remote file operation, it ruins Tramp's current
process handling. See the discussion at
<https://lists.gnu.org/archive/html/tramp-devel/2020-12/msg00003.html>
for a recent problem.

In order to fix this, I plan to push a patch, which let Tramp detect
this kind of situation. If Tramp is performing an atomic process
operation (process-send-string / accept-process-output sequence), it
creates an internal lock. If another remote file operation tries to
perform a similar atomic process operation, while Tramp is locked, an
error will be raised.

This should happen only for remote file operations called from
timers. It does not worsen the current situation; instead of blocking
whole Emacs we'll get an error which can be handled. The timer is
cancelled, but the normal Emacs operations still continue.

(Maybe there are similar problems with process sentinels, but I do not
recall a respective bug report)

People writing timer functions shall care, at least by wrapping such
calls with ignore-errors. Currently, a file-error is raised, but we
could also introduce a new error symbol.

Comments?

Best regards, Michael.



             reply	other threads:[~2020-12-11 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 16:58 Michael Albinus [this message]
2020-12-13 17:43 ` Tramp and timers Stefan Monnier
2020-12-13 18:37   ` Michael Albinus
2020-12-13 20:55     ` Stefan Monnier
2020-12-14  7:55       ` Michael Albinus

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft4c5lfu.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).