You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Christopher Brown (JIRA)" <ji...@apache.org> on 2014/04/16 17:46:16 UTC
[jira] [Commented] (HTTPCLIENT-1495) Finalizer in
PoolingHttpClientConnectionManager should not log "shutdown" messages if
already shutdown normally
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13971565#comment-13971565 ]
Christopher Brown commented on HTTPCLIENT-1495:
-----------------------------------------------
I've reviewed the changes by looking at the diffs linked to from this ticket. I won't be able to test in the near future.
Nevertheless, the changes look fine to me, I implemented something similar locally using a subclass of the pool the used a volatile boolean "_isShutdown" just to workaround the logging output. Your use of an AtomicBoolean is better (I particularly like the use of "compareAndSet" as a safeguard against concurrent shutdowns).
> Finalizer in PoolingHttpClientConnectionManager should not log "shutdown" messages if already shutdown normally
> ---------------------------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1495
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1495
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpConn
> Affects Versions: 4.3.1
> Reporter: Christopher Brown
> Priority: Minor
> Fix For: 4.3.4, 4.4 Alpha1
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org