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

BasicClientConnectionManager is not thread safe, remove @ThreadSafe annotation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.2 Final
    • 4.3 Alpha1
    • Documentation
    • None

    Description

      I would like to suggest removing the @ThreadSafe annotation on BasicClientConnectionManager. The javadoc clearly notes "it ought to be used by one execution thread only". Seems like a basic contradiction.

      Perhaps I am fundamentally not understanding the @ThreadSafe annotation. I thought that meant the class either has no static fields and/or creates all new objects and/or handles all necessary synchronization so that any number of threads may share an instance. What does it mean here, on a class that wraps a single connection for which access must be synchronized?

      Yes, after this problem bit us we switched to using PoolingClientConnectionManager.

      Thanks for considering this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrislott Chris Lott
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: