Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.14.1
-
Fix Version/s: 3.0
-
Component/s: Pico Web Remoting, PicoContainer (Java)
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
There are a number of ThreadLocals in PicoContainer and PWR that are not correctly disposed of.
DefaultPicoContainer#dispose should call
intoThreadLocal.remove();
intoThreadLocal = null;
DefaultPicoContainer#getComponent(Object, Type) should call
} finally { intoThreadLocal.set(null); intoThreadLocal.remove(); }
PicoServletContainerListener#contextDestroyed doesn't remove the ScopedContainers instance from the servlet context:
public void contextDestroyed(ServletContextEvent event) {
ScopedContainers scopedContainers = getScopedContainers(event.getServletContext());
stop(scopedContainers.getApplicationContainer());
dispose(scopedContainers.getApplicationContainer());
}
Storing#mapThreadLocalObjectReference should not be final and should be nulled by PicoServletContainerListener#contextDestroyed.
I think that should help with the errors logged by Tomcat.
So far have set up removal of the ThreadLocalDependencyGuard for Pico-3 core container. More work todo.