You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Neeme Praks (JIRA)" <ji...@apache.org> on 2013/09/09 16:31:56 UTC

[jira] [Updated] (HTTPCLIENT-1396) PoolingClientConnectionManager seems to create one connection too many?

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

Neeme Praks updated HTTPCLIENT-1396:
------------------------------------

    Description: 
See attached Junit test.
You'll also need Jetty dependency:
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>6.1.26</version>
      <scope>test</scope>
    </dependency>

What the test does:
* sets up a HTTP server (Jetty) with N number of threads processing requests (MAX_CONNECTIONS constant).
* sets up HttpClient with same N number of max connections (PoolingClientConnectionManager)
* sets up X workers, trying to connect to the server at the same time.

*Expected result*: although throughput is throttled (limited number of threads and connections), all workers should get successful response.

*Actual result:* at least one of the workers will get "java.net.SocketTimeoutException: Read timed out" error.

*Workaround:* limit HttpClient max connections to MAX_CONNECTIONS-1 and the test will pass.

Seems to be some off-by-one bug somewhere in PoolingClientConnectionManager.


  was:
See attached Junit test.
You'll also need Jetty dependency:
{format:xml}
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>6.1.26</version>
      <scope>test</scope>
    </dependency>
{format}

What the test does:
* sets up a HTTP server (Jetty) with N number of threads processing requests (MAX_CONNECTIONS constant).
* sets up HttpClient with same N number of max connections (PoolingClientConnectionManager)
* sets up X workers, trying to connect to the server at the same time.

*Expected result*: although throughput is throttled (limited number of threads and connections), all workers should get successful response.

*Actual result:* at least one of the workers will get "java.net.SocketTimeoutException: Read timed out" error.

*Workaround:* limit HttpClient max connections to MAX_CONNECTIONS-1 and the test will pass.

Seems to be some off-by-one bug somewhere in PoolingClientConnectionManager.


    
> PoolingClientConnectionManager seems to create one connection too many?
> -----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1396
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1396
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2.5
>         Environment: Any
>            Reporter: Neeme Praks
>            Priority: Minor
>
> See attached Junit test.
> You'll also need Jetty dependency:
>     <dependency>
>       <groupId>org.mortbay.jetty</groupId>
>       <artifactId>jetty</artifactId>
>       <version>6.1.26</version>
>       <scope>test</scope>
>     </dependency>
> What the test does:
> * sets up a HTTP server (Jetty) with N number of threads processing requests (MAX_CONNECTIONS constant).
> * sets up HttpClient with same N number of max connections (PoolingClientConnectionManager)
> * sets up X workers, trying to connect to the server at the same time.
> *Expected result*: although throughput is throttled (limited number of threads and connections), all workers should get successful response.
> *Actual result:* at least one of the workers will get "java.net.SocketTimeoutException: Read timed out" error.
> *Workaround:* limit HttpClient max connections to MAX_CONNECTIONS-1 and the test will pass.
> Seems to be some off-by-one bug somewhere in PoolingClientConnectionManager.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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