Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot kill thread with Readline #2841

e2 opened this issue Apr 16, 2015 · 2 comments

Cannot kill thread with Readline #2841

e2 opened this issue Apr 16, 2015 · 2 comments


Copy link

e2 commented Apr 16, 2015

The following never finishes on JRuby (never gets to the final line):

require 'readline'

th = { Readline.readline }
th.join(0.5) do
  sleep 2

STDERR.puts "continuing in foreground"
th.join # hangs here

STDERR.puts "Never gets here... ;("

Here are 2 relevant threads from a dump:

I don't know if this behavior is intended or not (I just want to quit Readline from a different thread).

Copy link

headius commented Apr 17, 2015

This is a known issue, and in fact there's another bug about it (at least one): #2383

There's currently no way to do readline non-blocking – a requirement for interrupting it – because we use the jline library. It builds off standard JDK stdio objects, which are not interruptible.

See linked issue for more details.

@headius headius closed this as completed Apr 17, 2015
@headius headius added this to the Invalid or Duplicate milestone Apr 17, 2015
Copy link

e2 commented Apr 17, 2015

Thanks! I was searching for "blocking" and "io" in the issues and couldn't find it. Didn't expect Readline to be in the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants