You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Joan Balagueró <jo...@grupoventus.com> on 2019/02/22 12:14:18 UTC
Thread named 'httpclient-main-1' not stopped when shutting down pool
Hello,
When I shutdown my CloseableHttpAsyncClientinstance (that has set a
PoolingAsyncClientConnectionManager) a thread called httpclient-main-1
is not stopped and the following message is logged in tomcat log:
22-Feb-2019 13:00:59.326 ADVERTENCIA [localhost-startStop-1]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [ROOT] appears to have started a thread named
[httpclient-main-1] but has failed to stop it. This is very likely to create
a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(
AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074
)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
34)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
24)
java.lang.Thread.run(Thread.java:748)
Our code to shutdown:
public void stop() throws IOException
{
this.phccm.close(CloseMode.GRACEFUL); // close the
PoolingAsyncClientConnectionManager gracefully
this.objHttp.close(); // close the
CloseableHttpAsyncClientinstance
}
Is this something Im forgetting to close or its a matter of the
Httpclient?
Thanks,
Joan.
Re: Thread named 'httpclient-main-1' not stopped when shutting down
pool
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2019-02-22 at 13:14 +0100, Joan Balagueró wrote:
> Hello,
>
>
>
> When I shutdown my ‘CloseableHttpAsyncClient’instance (that has set a
> ‘PoolingAsyncClientConnectionManager’) a thread called ‘httpclient-
> main-1’
> is not stopped and the following message is logged in tomcat log:
>
>
>
> 22-Feb-2019 13:00:59.326 ADVERTENCIA [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThrea
> ds The
> web application [ROOT] appears to have started a thread named
> [httpclient-main-1] but has failed to stop it. This is very likely to
> create
> a memory leak. Stack trace of thread:
>
> sun.misc.Unsafe.park(Native Method)
>
> java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
> .await(
> AbstractQueuedSynchronizer.java:2039)
>
> java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.jav
> a:442)
>
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.ja
> va:1074
> )
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
> java:11
> 34)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:6
> 24)
>
> java.lang.Thread.run(Thread.java:748)
>
>
>
> Our code to shutdown:
>
> public void stop() throws IOException
>
> {
>
> this.phccm.close(CloseMode.GRACEFUL); // close the
> ‘PoolingAsyncClientConnectionManager’’ gracefully
>
> this.objHttp.close(); // close the
> ‘CloseableHttpAsyncClient’instance
>
> }
>
>
>
> Is this something I’m forgetting to close or it’s a matter of the
> Httpclient?
>
Please post a test app reproducing the problem outside the servlet
container.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org