Neeme Praks created HTTPCLIENT-1396:
---------------------------------------

             Summary: 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:
{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.


--
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to