[ 
https://issues.apache.org/jira/browse/CXF-3614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willem Jiang resolved CXF-3614.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
                   2.4.2
                   2.3.6

Applied the patch into trunk, 2.4.x-fixes and 2.3.x-fixes branch.



> Thread leak in WorkQueueManagerImpl and AutomaticWorkQueueImpl when we use it 
> in tomcat
> ---------------------------------------------------------------------------------------
>
>                 Key: CXF-3614
>                 URL: https://issues.apache.org/jira/browse/CXF-3614
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.4.1
>            Reporter: David Liu
>            Assignee: Willem Jiang
>             Fix For: 2.3.6, 2.4.2, 2.5
>
>
> Hi,
>   There is the threadleak in WorkQueueManagerImpl / AutomaticWorkQueueImpl 
> when we use it in tomcat or other web container. In AutomaticWorkQueueImpl 
> created by WorkQueueManagerImpl, it has a class WatchDog which is a daemon 
> thread, If we call shutdown in WorkQueueManagerImpl, it only clean the queue 
> in AutomaticWorkQueueImpl but it won't notify WatchDog thread, so the 
> WatchDog will wait and live until we exit JVM.
>   It won't cause issue if we run CXF as standalone app, however, it will 
> cause thread leak in tomcat because we do not stop tomcat when we undeploy 
> cxf web-app, so we cannot destroy WatchDog thread in this case.
>   Could you please fix it? thanks.
> {code}
> public class MyWorkQueueManagerImpl extends WorkQueueManagerImpl implements 
> DisposableBean {
>     @Override
>     public void destroy() throws Exception {
>         this.shutdown(false);
>         for (AutomaticWorkQueue queue : namedQueues.values()) {
>             if (queue instanceof AutomaticWorkQueueImpl) {
>                 AutomaticWorkQueueImpl queueimpl = ((AutomaticWorkQueueImpl) 
> queue);
>                 queueimpl.terminated();
>                 queueimpl.watchDog.interrupt();
>             }
>         }
>     }
> }
> {code}
> David

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to