In our web-application A user can submit a url. We will fetch the data and parse it server side. For each request we use an HttpClient with the following (relevant) settings
connectionManager.getParams().setConnectionTimeout(10000);
connectionManager.getParams().setSoTimeout(10000);
When I call HttpMethod.getResponseBody the status code has already been checked to be acceptable. At this point the thread hangs with this stack trace:
java.net.SocketInputStream.socketRead0 ( native code )
java.net.SocketInputStream.read ( SocketInputStream.java:150 )
java.net.SocketInputStream.read ( SocketInputStream.java:121 )
java.io.BufferedInputStream.read1 ( BufferedInputStream.java:273 )
java.io.BufferedInputStream.read ( BufferedInputStream.java:334 )
java.io.FilterInputStream.read ( FilterInputStream.java:133 )
org.apache.commons.httpclient.AutoCloseInputStream.read ( AutoCloseInputStream.java:108 )
java.io.FilterInputStream.read ( FilterInputStream.java:107 )
org.apache.commons.httpclient.AutoCloseInputStream.read ( AutoCloseInputStream.java:127 )
org.apache.commons.httpclient.HttpMethodBase.getResponseBody ( HttpMethodBase.java:690 )
I cannot discover the exact URL for which this happened (was an incident on a live environment) and I have been unable to reproduce it. I'd like to think it's simply a matter of the server we're connecting to behaving strangely, but perhaps I'm missing something. In either case, is there a way for me to prevent the blocking method call from waiting forever? The SoTimeout is also the socket read timeout? Is there another setting I'm missing?