Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2299

The socketTimeout parameter in ConnectionConfig does not take effect when reusing an existing connection.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.3-alpha1
    • 5.2.2, 5.3
    • HttpClient (classic)
    • None

    Description

      I have created an instance of PoolingHttpClientConnectionManager and set a socket timeout of 5 seconds in the ConnectionConfig. In this case, when accessing a backend service with a response time of 10 seconds for the first time, a SocketTimeoutException was correctly thrown. But in the second request, when reusing an already established connection, the client waited for 10 seconds and completed the request. Instead, if I set a 5-second SoTimeout in SocketConfig and run the test again. The setting works.

      runnable test cases: https://github.com/ksewen/httpclient-demo

      I have uploaded an attachment that demonstrates the configured value of the SocketTimeout when the connection is being reused.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ksewen ksewen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: