You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Basin Ilya <ba...@gmail.com> on 2018/02/14 10:17:28 UTC

Thoughts on bug #254761

Hi.
In case of wrong setup a `cvs log` command may print nothing. This makes the LoggedDataInputStream#read() method in the Netbeans CVS client loop forever. See this SO
question for details:
https://stackoverflow.com/questions/48741854/inputstream-wrapper-with-actual-read-in-a-dedicated-thread

There's a bug mentioning sleep() inside LoggedDataInputStream: https://netbeans.org/bugzilla/show_bug.cgi?id=254761

There are two types of input streams the LoggedDataInputStream works with. If it's a server connection, the stream is a SocketInputStream. If it's a local connection, the
stream is a read side of a pipe returned by Process.getInputStream().

I suppose that we want to keep the Thread.interrupted() check in LoggedDataInputStream, but using available() is definitely not the right way to check for premature EOF.
I also suppose that we want to keep the java 6 level.

I want to but remove the sleep() and available() calls from LoggedDataInputStream and instead catch the SocketTimeoutException and check the interrupted status on a timeout.

In case of a socket we will set the socket timeout to 100ms.
In case of a pipe we will perform reading in a dedicated thread. See the SO question above.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists