zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: [Feature suggestion] (user configurable) timeout for generating completion lists
Date: Wed, 22 Jan 2014 00:04:35 -0800	[thread overview]
Message-ID: <140122000435.ZM1516@torch.brasslantern.com> (raw)
In-Reply-To: <CACcU-g0qb3gZVLPPS2bQBixuozSsXd_9ObK+V6CTcaP4qfiFtA@mail.gmail.com>

On Jan 20,  4:13pm, Arseny Tolmachev wrote:
} 
} Sometimes you press [Tab] by instinct when in directory that is
} network-mounted and has some millions files in it.
} In this situation zsh basically ignores the [Ctrl+C] and don't respond to
} anything for a bit of time.

There are two possible situations here.  (Probably more than two, but
only two likely ones.)

(1) The shell process is actually in "disk wait" condition, blocked to
wait for the NFS volume to respond.  If this is the case, there's not
a lot that can be done; any timeout that might be set up will also be
held until the disk condition clears.

(2) The shell is chewing CPU cycles for a large amount of file data,
but ignoring or deferring some signals while it does so.  In this case
there's some hope of a timeout working.

It could also be switching back and forth between these two states ...
but that can be treated as case (2) except that it might take longer
for the timeout to work.

} It would be very great if there was a way to specify a timeout for
} completion generation for zsh. Error message can be something like
} "completion timeouted".
} What do you think about this?

I've been poking at it for a couple of hours trying to repeatably induce
case (2), and I can't get reliably force it to happen.  It would be
helpful if somebody who experiences this problem could attach to the
stuck zsh with gdb and grab a stack trace.  Note that in case (1) above,
gdb is likely to end up wedged as well.

Anyway, anything we could do for a timeout would likely require handling
a signal, which pretty much means we're going to bail out of the shell
functions (e.g., _main_complete and everything below it) that perform
completion.  I don't immediately see how to produce an error message in
that case without messing up the ZLE display unless we also have a shell
level trap handler (instead of a purely internal one).  But in order to
even get that far, we have to know what's holding things up.


  reply	other threads:[~2014-01-22  8:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20  7:13 Arseny Tolmachev
2014-01-22  8:04 ` Bart Schaefer [this message]
2014-01-23 12:04   ` Nikolai Weibull
2014-01-24  1:16     ` Bart Schaefer
2014-01-24  9:00       ` Nikolai Weibull
2014-01-25 20:09         ` _git and partial completion, again Bart Schaefer
2014-01-24 14:46       ` [Feature suggestion] (user configurable) timeout for generating completion lists Greg Klanderman
2014-01-25 20:49         ` Bart Schaefer
2014-01-29 16:29           ` Greg Klanderman
2014-02-25 15:35           ` Greg Klanderman
2014-01-22 13:51 ` Shawn Wilson

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=140122000435.ZM1516@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).