[
https://issues.apache.org/jira/browse/HTTPCLIENT-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski updated HTTPCLIENT-1298:
------------------------------------------
Fix Version/s: 4.3 Alpha2
We cannot add #shutdown method to the HttpClient interface, so it may not be
easy to fix this issue in the 4.2.x branch. CloseableHttpClient in the trunk,
however, can do extra cleanups beside the expected shutdown of the connection
manager. Have a loot at the CachingHttpClientBuilder in the caching module and
see how it registers an extra Closeable with the underlying CloseableHttpClient
implementation to ensure automatic cleanup of the file cache when the client
shuts down. You could do something very similar for the executor service used
by its AsynchronousValidator.
Oleg
> Unable to shutdown executor service used by AsynchronousValidator
> -----------------------------------------------------------------
>
> Key: HTTPCLIENT-1298
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1298
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: Cache
> Affects Versions: 4.2.3
> Reporter: Martin Meinhold
> Fix For: 4.3 Alpha2
>
>
> Currently there is no way to tell the CachingHttpClient to shutdown the
> executor service used by its AsynchronousValidator. This could lead to a
> resource leak, but probably only in cases when the threads weren't reclaimed
> by the thread pool. So only when it is actually processing tasks. As long as
> the thread pool isn't used, it won't create threads.
> From an application life-cycle point of view there should be a way to
> explicitly tell the HttpClient to shutdown and release all resources now
> regardless whether there are any outstanding validation requests or not.
> I have a patch against version 4.2.1 which in fact adds a shutdown() method
> to the HttpClient and the AsynchronousValidator. Today I saw, there is
> already a CloseableHttpClient. So do you need any contribution to fix this?
> Looks like there is already a plan for that.
> Btw: thanks for already supporting the background validation via the
> stale-while-revalidate header.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]