You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2014/02/17 16:56:23 UTC

[jira] [Resolved] (HTTPASYNC-69) calling IOControl.shutdown() doesn't release the underlying connection

     [ https://issues.apache.org/jira/browse/HTTPASYNC-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPASYNC-69.
----------------------------------------

    Resolution: Fixed

Sadly, the resolution of this issue also involved changes to core protocol components [1], which we just had a new release of. Still with this fix [2] one can now abort a request (1) by throwing an exception, (2) by cancelling the response consumer, and (3) once HttpCore dependency is upgraded to version 4.3.3 by shutting down the connection with IOControl#shutdown.

Please review / re-test with the latest snapshots.

Oleg

[1] http://svn.apache.org/viewvc?view=revision&revision=r1569023
[2] http://svn.apache.org/viewvc?view=revision&revision=r1569026

> calling IOControl.shutdown() doesn't release the underlying connection
> ----------------------------------------------------------------------
>
>                 Key: HTTPASYNC-69
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-69
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0 Final
>         Environment: MacBook Pro, OSX
>            Reporter: Yoram Dayagi
>             Fix For: 4.0.1
>
>
> Below is the log of the following scenario:
> 1. Create an async client with MaxConnPerRoute=1
> 2. Start a request 
> 3. Wait for 100ms and shutdown the channel (using ioctrl.shutdown)
> 4. Wait for 2000ms and start another request for same url
> 2014/02/17 12:34:15:587 IST [DEBUG] PoolingNHttpClientConnectionManager - Connection request: [route: {}->http://966b.http.dal05.cdn.softlayer.net:80][total kept alive: 0; route allocated: 0 of 1; total allocated: 0 of 10]
> 2014/02/17 12:34:15:681 IST [DEBUG] PoolingNHttpClientConnectionManager - Connection leased: [id: http-outgoing-0][route: {}->http://966b.http.dal05.cdn.softlayer.net:80][total kept alive: 0; route allocated: 1 of 1; total allocated: 1 of 10]
> 2014/02/17 12:34:15:689 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][r:]: Set attribute http.nio.exchange-handler
> 2014/02/17 12:34:15:690 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][rw:]: Event set [w]
> 2014/02/17 12:34:15:691 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][rw:]: Set attribute http.nio.http-exchange-state
> 2014/02/17 12:34:15:692 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][rw:]: Event set [w]
> 2014/02/17 12:34:15:694 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][rw:w]: 246 bytes written
> 2014/02/17 12:34:15:694 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][r:w]: Event cleared [w]
> 2014/02/17 12:34:15:770 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][r:r]: 1360 bytes read
> 2014/02/17 12:34:15:775 IST [DEBUG] ManagedNHttpClientConnectionImpl - http-outgoing-0 10.0.0.2:58623<->93.184.221.133:80[ACTIVE][r:r]: Shutdown
> 2014/02/17 12:34:17:695 IST [DEBUG] PoolingNHttpClientConnectionManager - Connection request: [route: {}->http://966b.http.dal05.cdn.softlayer.net:80][total kept alive: 0; route allocated: 1 of 1; total allocated: 1 of 10]
>  
> Note that the last log of “Connection request” reports that “route allocated: 1 of 1”. 
> It probably means that the connection was not released when the channel was shut down.
> From the client perspective, the consumer’s onByteReceived is never called after this point.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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