Bug 414516 - Connection Reset exception running Ant UI separate VM tests
Summary: Connection Reset exception running Ant UI separate VM tests
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M1   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-06 12:50 EDT by Michael Rennie CLA
Modified: 2015-03-24 18:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2013-08-06 12:50:29 EDT
While trying to reproduce the DNF's locally, I got the following:

java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:189)
	at java.net.SocketInputStream.read(SocketInputStream.java:121)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:154)
	at java.io.BufferedReader.readLine(BufferedReader.java:317)
	at java.io.BufferedReader.readLine(BufferedReader.java:382)
	at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:93)

Looks like we are trying to read from the closed socket. It can happen that the socket has been closed and a read takes place before we are notified of the launch being removed. Should probably add in an ILaunch#isTerminated check to: 

while (fLaunch != null && fBufferedReader != null && (message = fBufferedReader.readLine()) != null) {
Comment 2 Roman Fischer CLA 2015-03-24 17:09:04 EDT
Hallo
Comment 3 Roman Fischer CLA 2015-03-24 17:26:52 EDT
The use of the ready() Methode on the BufferedReader in the commit of this fix ist cause an high cpu consume. See on windows with java 7 and java 8 with  eclipse 4.4.1. if i change the while loop code back to use only the readLine() Methode:

// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=414516
// the launch can be terminated but we haven't been notified yet
String message;
while (fLaunch != null && !fLaunch.isTerminated() && fBufferedReader != null && (message = fBufferedReader.readLine()) != null) {
    receiveMessage(message);
					
}



then everthing ok.
Comment 4 Dani Megert CLA 2015-03-24 18:51:47 EDT
(In reply to Roman Fischer from comment #2)
> Hallo

If you see a bug/regression then please file a new bug with steps to reproduce the problem.