Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Tiger
-
Tiger Sprint 196 - Hardening
Description
An (mostly) annoying error always logged when Tomcat is stopped is that the Wicket-PageSavingThread is failed to stop:
WARNING [Thread-27] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [cms] appears to have started a thread named [Wicket-PageSavingThread] 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.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:345)
After some debugging it turned out to be an oversight in our (producting mode only) AmnesicPageStore implementation which does not pass on the destroy method call to the AsynchronousDataStore it ignores.
The fix is trivial: instead of a fully dummy IPageStore implementation, the AmnesicPageStore need to keep a reference to the underlying datastore, and (only) invoke its destroy() method when it is destroyed itself.