RFR JDK-8166890: JShell: locks forever when input is piped
ShinyaYoshida
bitterfoxc at gmail.com
Mon Oct 10 13:20:22 UTC 2016
Hi Jan,
Thank you for fixing this!
Your patch works well on my environment!
Couldn't we write a test case for this?
Trivial:
synchronized (StopDetectingInputStream.this) {
- state = StopDetectingInputStream.State.CLOSED;
+ shutdown();
}
Is this synchronized block still necessary?
Could it be removed because shutdown() is a synchronized method?
Regards,
shinyafox(Shinya Yoshida)
2016-10-10 19:21 GMT+09:00 Jan Lahoda <jan.lahoda at oracle.com>:
> Hi,
>
> When an input is redirected to jshell, like:
> echo "1" | jshell
>
> Then jshell locks, as it waits for the terminal to report the cursor
> position. Also, when the input is fully read, the StopDetectingInputStream
> is set to the CLOSED state, but the state may be cleared using setState,
> causing the readers from the StopDetectingInputStream to wait indefinitely.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8166890
>
> Webrevs:
> jdk:
> http://cr.openjdk.java.net/~jlahoda/8166890/jdk.00/
> langtools:
> http://cr.openjdk.java.net/~jlahoda/8166890/langtools.00/
>
> Any feedback is welcome.
>
> Thanks,
> Jan
>
More information about the kulla-dev
mailing list