hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: A question about ConnectTimeout and SoTimeout
Date Mon, 25 Aug 2014 19:03:43 GMT
On 25/08/14 16:51 , whybert wrote:
> 2014/08/25 22:49:05:698 CST [DEBUG] MainClientExec - [exchange: 1] start execution
> 2014/08/25 22:49:05:709 CST [DEBUG] RequestAddCookies - CookieSpec selected: best-match
> 2014/08/25 22:49:05:719 CST [DEBUG] RequestAuthCache - Auth cache not set in the context
> 2014/08/25 22:49:05:719 CST [DEBUG] InternalHttpAsyncClient - [exchange: 1] Request connection
for {}->http://1.1.1.1:80
> 2014/08/25 22:49:05:721 CST [DEBUG] PoolingNHttpClientConnectionManager - Connection
request: [route: {}->http://1.1.1.1:80][total kept alive: 0; route allocated: 0 of 2; total
allocated: 0 of 20]
> 2014/08/25 22:49:26:729 CST [DEBUG] PoolingNHttpClientConnectionManager - Connection
request failed <java.net.ConnectException: Connection timed out: no further information>java.net.ConnectException:
Connection timed out: no further information
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
> at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
> at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173)
> at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147)
> at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
> at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189)
> at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67)
> at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38)
> at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57)
> at java.lang.Thread.run(Unknown Source)
>
>
> 2014/08/25 22:49:26:731 CST [DEBUG] InternalHttpAsyncClient - [exchange: 1] connection
request failed
> 2014/08/25 22:49:26:732 CST [DEBUG] PoolingNHttpClientConnectionManager - Connection
manager is shutting down
> 2014/08/25 22:49:26:737 CST [DEBUG] PoolingNHttpClientConnectionManager - Connection
manager shut down
> 21008
> java.net.ConnectException: Connection timed out: no further information
>
>
>
>>> It took 21 seconds to get a ConnectException while the ConnectTimeout was 2 seconds.
>>> Could you help me to look at this problem? Thanks!
>>>
>>
>> Whybert
>>

Whybert

If you look at the stack trace and correlate it with the source code 
you'll see that the exception was thrown from a native 
SocketChannelImpl#checkConnect method after the underlying channel was 
selected as connectable by the I/O selector (see 
DefaultConnectingIOReactor#processEvent method). This looks like a 
platform specific issue to me, which might be a bug (or a feature) of 
the JRE or of the underlying OS TCP/IP stack.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message