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

Not properly closing connections in BasicHttpClientConnectionManager

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5.5
    • Fix Version/s: 4.5.6
    • Component/s: HttpClient (classic)
    • Labels:
      None

      Description

      Seems we are hitting something similiar to the HTTPCLIENT-1655 issue, where established connections were not properly closed (client sends Reset instead of FIN+ACK)

      We are using

      BasicHttpClientConnectionManager (4.5.5 httpclient version)

      and when we are calling client.close(), we see packet with Reset flag enabled in tcpdump

       

      Looks like here: https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java#L378

      must be closeConnection()

      https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/main/java/org/apache/http/impl/conn/BasicHttpClientConnectionManager.java#L209

      instead of shutdownConnection

       

      This issue is not present if we are using PoolingHttpClientConnectionManager

      (in shutdown() there are pool.shutdown:

      https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java#L410

      where for each entry runs: entry.close() -> this.closeConnection();) - we see normal connection close (FIN+ACK)

       

      What do you think about it?

      Thank you

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Arsenev Aleksei
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: