hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hansen <m...@proxisoft.com>
Subject MultiThreadedHttpConnectionManager throwing I/O Exceptions
Date Thu, 17 Feb 2011 13:55:53 GMT
I am working on a large middleware application that uses HttpClient 3.1 and Spring RestTemplate
to handle RESTful calls to about 40 different services.

We are using MultiThreadedHttpConnectionManager as HTTPClient's connection manager.

We get intermittent I/O Errors as we scale to a multi-user / multi-thread environment that
we do not see when running single-user tests in the development environment.

Has anyone else experienced a similar problem?  Can anyone suggest a solution or approach
we might try?

The network people at the company where I'm working say that they see "out of state packets"
causing their firewall to drop our connections.

MultiThreadedHttpConnectionManager is currently configured like this:

maxConnectionsPerHost = 1
maxTotalConnections = 0
staleCheckingEnabled = true

We used to have MultiThreadedHttpConnectionManager configured like this, but the change has
made no difference.

maxConnectionsPerHost = 50
maxTotalConnections = 100



Below is a typical stack trace from an I/O Exception.

Caused by: org.springframework.web.client.ResourceAccessException: I/O error: Read timed out;
nested exception is java.net.SocketTimeoutException: Read timed out
        at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453)
        at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
        at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:206)
        at com.nytimes.cil.service.regi.RegiServiceImpl.searchRegiAccount(RegiServiceImpl.java:115)
        ... 91 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
        at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.springframework.http.client.CommonsClientHttpRequest.executeInternal(CommonsClientHttpRequest.java:83)
        at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:52)
        at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:438)
        ... 94 more

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message