Hi Oleg,
I'm not able to log anything in the http log file.
I'm using log4j2, and these are my appender and logger:
<File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" append="true"
immediateFlush="true">
<PatternLayout><Pattern>%m%n</Pattern></PatternLayout>
</File>
<Logger name="org.apache.hc" level="debug" includeLocation="false"
additivity="false">
<AppenderRef ref="HTTP_LOG"/>
</Logger>
The ' httpClient5.log' is correctly created, but nothing is logged when I start
and stop my HttpClient instance. Is the logger name 'org.apache.hc' correct?
Thanks,
Joan.
-----Mensaje original-----
De: Oleg Kalnichevski [mailto:[email protected]] Enviado el: sábado, 23 de
febrero de 2019 17:36
Para: HttpClient User Discussion
Asunto: Re: Thread named 'httpclient-main-1' not stopped when shutting down pool
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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]