-
Bug
-
Resolution: Unresolved
-
Major
-
None
We get this socket timeout the odd occasion, as you can see we have tried setting the HttpTimeout to a big number but it doesn't seem to help.
12:59:36 hudson.plugins.fitnesse.FitnesseBuilder:
{fitnesseTargetPage=PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax, fitnesseTargetIsSuite=true, fitnesseHost=Private, fitnesseHttpTimeout=2700000, fitnessePortRemote=8886, fitnesseStart=False, fitnessePathToXmlResultsOut=C:\PayGlobal\FitNesse\Results\XESuiteNZTax_Results.xml}12:59:36 Connnecting to http://PAYFIT003:8886/PayrollTeam.ModulePayroll.AaTaxArea.NewZealandTax?suite&format=xml&includehtml
12:59:36 Connected: 200/OK
13:44:46 java.net.SocketTimeoutException: Read timed out
13:44:46 at java.net.SocketInputStream.socketRead0(Native Method)
13:44:46 at java.net.SocketInputStream.read(Unknown Source)
13:44:46 at java.net.SocketInputStream.read(Unknown Source)
13:44:46 at java.io.BufferedInputStream.fill(Unknown Source)
13:44:46 at java.io.BufferedInputStream.read1(Unknown Source)
13:44:46 at java.io.BufferedInputStream.read(Unknown Source)
13:44:46 at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)
13:44:46 at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)
13:44:46 at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
13:44:46 at java.io.FilterInputStream.read(Unknown Source)
13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
13:44:46 at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor.getHttpBytes(FitnesseExecutor.java:230)
13:44:46 at hudson.plugins.fitnesse.FitnesseExecutor$1.run(FitnesseExecutor.java:201)
13:44:46 at java.lang.Thread.run(Unknown Source)
I've had a quick look at the code and I'm pretty sure this is where it is crashing:
try {
log.println("Connnecting to " + pageCmdTarget);
HttpURLConnection connection = (HttpURLConnection) pageCmdTarget.openConnection();
connection.setReadTimeout(httpTimeout);
log.println("Connected: " + connection.getResponseCode() + "/" + connection.getResponseMessage());
inputStream = connection.getInputStream();
long recvd = 0, lastLogged = 0;
byte[] buf = new byte[4096];
int lastRead;
while ((lastRead = inputStream.read(buf)) > 0) {
bucket.write(buf, 0, lastRead);
timeout.reset();
recvd += lastRead;
if (recvd - lastLogged > 1024)
}
} catch (IOException e)
finally {
if (inputStream != null) {
try
catch (Exception e)
{ // swallow } }
}
I'm not very good with networking code so would someone please be able to look at this for me and see if there is an issue or suggest something environmentally we could do to avoid these timeouts?
Cheers,
Sam
[JENKINS-18501] Fitnesse Plugin - java.net.SocketTimeoutException: Read timed out
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: Open [ 1 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Workflow | Original: JNJira [ 149808 ] | New: JNJira + In-Review [ 206745 ] |
Resolution | Original: Fixed [ 1 ] | |
Status | Original: Closed [ 6 ] | New: Reopened [ 4 ] |
Hey all, me and another developer here have been looking into this further and we see that there is only 1 variable used for the httpTimeout and the tests timeout. This is not good in our case as it may take 45 minutes to run a test (big reports) but it also means it will take 45 minutes for the test to fail if the http fails to connect and timeout.
Also it doesn't seem to retry to connect if it fails to connect the first time?