hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirill Barkunov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPASYNC-109) Requests in AbstractNIOConnPool.pending stays forever.
Date Mon, 01 Aug 2016 19:43:20 GMT

    [ https://issues.apache.org/jira/browse/HTTPASYNC-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402693#comment-15402693
] 

Kirill Barkunov commented on HTTPASYNC-109:
-------------------------------------------

Sorry, I did not know that it matters. Actually on completion I make the following:
{code}
String json = EntityUtils.toString(httpsResponse.getEntity());
// do smth with json
{code}
As I see, this util method closes stream that uses. Other 2 callback methods really do nothing
except logging.
And, by the way, firewall, as I know, cuts any connection, not only ones with idle state.


As I understand from the docs you provided, I need to call response.close() only if I want
to close current connection. But since I'm making all the request to the same target host
I want to use connection multiple times to improve performance.

Your point is that I don't handle the response in 'completed' callback properly, right?
I was trying to reproduce this issue on my local machine, but i did not manage to succeed.
I was trying to send few thousands requests  per second (with the same config as above. without
closing the response) but it was working properly all the time. I was only able to make one
entry stays in 'leased' set forever. (and I don't know how. It happened only once during my
tests.)

Thanks!
Kirill.

> Requests in AbstractNIOConnPool.pending stays forever.
> ------------------------------------------------------
>
>                 Key: HTTPASYNC-109
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-109
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.1.2
>            Reporter: Kirill Barkunov
>
> Hi!
> I have a client built this way:
> {code}
> IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
>             .setIoThreadCount(Runtime.getRuntime().availableProcessors())
>             .setConnectTimeout(30000)
>             .setSoTimeout(30000)
>             .build();
>     private CloseableHttpAsyncClient httpAsyncClient = HttpAsyncClients.custom().setMaxConnTotal(150).setMaxConnPerRoute(130).setDefaultIOReactorConfig(ioReactorConfig).build();
> {code}
> I've noticied that on environment with a firewall enabled (I think it cuts all the socket
connection 5 minutes after their establishing) after some time client stops sending https
request. After a small investigation I've started to monitor insides of the client and noticied
that a few minutes after the client start - AbstractNIOConnPool.pending collection starts
to grow. At start it's 0. After few minutes it's 1-2. Then it starts to grow faster and few
minutes later it reaches maximum number of connections per route. And it stops work forever.
Only AbstractNIOConnPool.leasingRequests grows and no one of the new requests are processed.
> Target for all the requests is www.googleapis.com
> As I can understand from client insides load is like 1-5 request at a time.
> I mean before first "dead" request in AbstractNIOConnPool.pending the number of "leased"
and "available" is not more than 5.
> Best regards, Kirill.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message