unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cc: luangruo@yahoo.com, 53432@debbugs.gnu.org
Subject: bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy [and 1 more messages]
Date: Sat, 22 Jan 2022 21:48:21 +0200	[thread overview]
Message-ID: <8335lfmu0q.fsf@gnu.org> (raw)
In-Reply-To: <25068.23625.512978.147194@chiark.greenend.org.uk> (message from Ian Jackson on Sat, 22 Jan 2022 19:34:33 +0000)

> From: Ian Jackson <ijackson@chiark.greenend.org.uk>
> Date: Sat, 22 Jan 2022 19:34:33 +0000
> Cc: 53432@debbugs.gnu.org
> 
> Eli Zaretskii writes ("Re: bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy"):
> > Thanks.  I doubt that we want to complicate our input handling this
> > way on behalf of "abusing" inotify.  File notifications are known not
> > to be scalable enough to support global-auto-revert-mode well.
> 
> The problem is that keystrokes (and file notifications) get lost.  I
> don't think we should be shipping code that can do that.  Even if it
> only does it if you are working on a program whose build system writes
> a lot of files, and/or have a slow computer, and/or are unlucky.  Note
> that magit turns on global-auto-revert-mode so this is a very common
> configuration.  Loss of file updates is also a real problem, becuase
> it can lead to the user editing an old version of a file.

Which is why we recommend turning off file-notifications when you turn
on global-auto-revert-mode.

> The fact that I have to "abuse" things to demonstrate the race, does
> not mean that it's not a real bug.  That's in the nature of race bugs.

What race is that?  This processing is going on in a single thread, so
how can there be any races?

> > The best thing to do, IMO, would be to simply not store any
> > FILE_NOTIFY_EVENTS if the keyboard buffer is full, which shouldn't
> > affect normal use of file notifications, and would result in less change
> > to the keyboard code.
> 
> Wouldn't that lead to file notifications getting lost ?

Yes, but inotify (and other similar features on other OSes) doesn't
guarantee that all the events be delivered when there are many of
them.  Which is one more reason not to use file notifications to watch
too many files/directories.  This stuff isn't scalable enough.

> Eli:
> > In any case, installing this on the emacs-28 branch is out of the
> > question: it's too late for that.  We may install some variant of this
> > on master, after discussing how best to handle this.  Po Lu's
> > suggestion to stop processing inotify events sounds better to me.
> 
> I was advised by a friend that I ought to send patches against
> the emacs-28 branch, so I did that.  Indeed, CONTRIBUTING says
> 
>   If you are fixing a bug that exists in the current release, you should
>   generally commit it to the release branch;

It also says, right after that

						      However, when the
  release branch is for Emacs version NN.2 and later, or when it is for
  Emacs version NN.1 that is in the very last stages of its pretest,
  that branch is considered to be in a feature freeze: only bug fixes
  that are "safe" or are fixing major problems should go to the release
  branch, the rest should be committed to the master branch.  This is so
  to avoid destabilizing the next Emacs release.  If you are unsure
  whether your bug fix is "safe" enough for the release branch, ask on
  the emacs-devel mailing list.

> > > I hope the commit messages are in the expected format.  I think I
> > > probably have GNU copyright paperwork on file already, perhaps under a
> > > different email address.
> > 
> > I don't see your name or email address on file, so maybe they are both
> > different?
> 
> My name hasn't changed.  But I'm happy to do the paperwork (even if it
> would be "again").  If it did happen, it will have been a long long
> time ago.

Sorry, I don't see your name there.  I just rechecked.





  reply	other threads:[~2022-01-22 19:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 23:36 bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy Ian Jackson
2022-01-22  0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-22 19:34   ` bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy [and 1 more messages] Ian Jackson
2022-01-22 19:48     ` Eli Zaretskii [this message]
2022-01-23  2:37       ` Dmitry Gutov
2022-01-23  2:47         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  2:49           ` Dmitry Gutov
2022-01-23  2:53             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  3:23               ` Dmitry Gutov
2022-01-23  3:26                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  3:36                   ` Dmitry Gutov
2022-01-23  3:48                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23  4:07                       ` Dmitry Gutov
2022-01-23  5:50                   ` Eli Zaretskii
2022-01-23 16:34                     ` Michael Albinus
2022-01-23  1:00     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-23 13:38       ` Ian Jackson
2022-01-23 16:37         ` Michael Albinus
2022-01-23 18:31           ` Ian Jackson
2022-01-24  0:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-24 14:42             ` Michael Albinus
2022-01-24 14:57               ` Eli Zaretskii
2022-01-24 15:35                 ` Michael Albinus
2022-01-24 16:52                   ` Eli Zaretskii
2022-01-24 17:12                     ` Michael Albinus
2022-01-24 17:25                       ` Eli Zaretskii
2022-01-24 15:45               ` Ian Jackson
2022-01-24 17:05                 ` Michael Albinus
2022-01-24 18:59                   ` Ian Jackson
2022-01-25 14:50                     ` Michael Albinus
2022-01-24  0:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-22  6:45 ` bug#53432: [PATCH] Avoid losing keyboard input when inotify is too busy Eli Zaretskii

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=8335lfmu0q.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53432@debbugs.gnu.org \
    --cc=ijackson@chiark.greenend.org.uk \
    --cc=luangruo@yahoo.com \
    /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).