Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 64712 invoked from network); 28 Sep 2010 21:44:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Sep 2010 21:44:56 -0000 Received: (qmail 73690 invoked by uid 500); 28 Sep 2010 21:44:56 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 73621 invoked by uid 500); 28 Sep 2010 21:44:55 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 73613 invoked by uid 99); 28 Sep 2010 21:44:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 21:44:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 21:44:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8SLiY6F004954 for ; Tue, 28 Sep 2010 21:44:34 GMT Message-ID: <30203617.451651285710274026.JavaMail.jira@thor> Date: Tue, 28 Sep 2010 17:44:34 -0400 (EDT) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Subject: [jira] Resolved: (HTTPCORE-237) Getting very frequent SocketTimeOutException In-Reply-To: <11112249.449801285704345224.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCORE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCORE-237. ---------------------------------------- Resolution: Invalid Simona This is because the socket timeout value set by your application must be too aggressive (too low). This is most certainly not a bug in HttpCore. Try increasing the socket timeout. Oleg > Getting very frequent SocketTimeOutException > -------------------------------------------- > > Key: HTTPCORE-237 > URL: https://issues.apache.org/jira/browse/HTTPCORE-237 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore > Affects Versions: 4.0.1, 4.0.2 > Environment: PROD > Reporter: Simona Afifi > > We are using ThreadSafeClientConnManager and we close the stream at the finally block and yet we see very frequent occurences of this exception: > java.net.SocketTimeoutException: Read timed out > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:129) > at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:130) > at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:127) > at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:233) > at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98) > at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:210) > at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:271) > at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:227) > at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:209) > at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:292) > at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:126) > at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:483) > at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) > at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) > at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) > Sample code: > HttpClientWrapper.class > public HttpResponse execute(HttpPost httpPost, int timeout) throws IOException { > HttpClient httpClient = new DefaultHttpClient(connManager, initParams(timeout)); > httpClient.getConnectionManager().closeExpiredConnections(); > return httpClient.execute(httpPost); > } > Service.class > ------------------- > private String invokeHttpGet(HttpGet httpGet) throws Exception { > String responseStr=""; > HttpEntity entity= null; > try{ > HttpResponse response = httpClientWrapper.execute(httpGet); > entity = response.getEntity(); > if (entity != null) { > responseStr = EntityUtils.toString(entity); > } > }catch(Exception e){ > if(httpGet!=null) > httpGet.abort(); > > throw e; > }finally{ > if(entity!=null) entity.consumeContent(); > } > return responseStr; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org