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

Finalizer in PoolingHttpClientConnectionManager should not log "shutdown" messages if already shutdown normally

    XMLWordPrintableJSON

Details

    Description

      Despite shutting down the CloseableHttpClient instance using "close()", which in turn calls shutdown() on the PoolingHttpClientConnectionManager, messages are still logged such as the following in all cases after a JVM garbage collection:

      [Finalizer] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection manager is shutting down

      The finalizer thread always calls "shutdown", which always logs the "shutdown" messages. This led me to believe (when tracking memory leaks) that there was a problem in my usage of HTTP client, when in fact the message was just misleading (everything was fine).

      It would be preferable, perhaps via a volatile boolean instance field on the connection manager, to suppress the shutdown messages (and maybe even suppress redundant resource cleanup attempts). This would help users of the library to concentrate on other issues.

      Thanks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cbr.reflexe Christopher Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: