Tomcat complains about Lift Scheduler thread on context stop/reload
Scala 2.8.1, Lift 2.3, Tomcat 6.0.32 (haven't tried Tomcat 7.x.x)
Catalina.log:
According to http://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp adding:
In case of Lift that would mean modifying net/liftweb/util/ Schedule.scala:
No idea what impact this change would have in Jetty and other containers.
Any plans on adding this workaround or rather waiting it out (hoping that Tomcat guys can sort it out)?
See also: http://groups.google.com/group/liftweb/browse_frm/thread/44f4b42115d666d8
Catalina.log:
12:20:44.623 [http-8080-3] DEBUG net.liftweb.http.LiftServlet - Destroyed Lift handler.
May 4, 2011 12:20:44 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/token-service] appears to have started a thread named [Lift Scheduler] but has failed to stop it. This is very likely to create a memory leak.
According to http://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp adding:
thread.setContextClassLoader(null)
would take care of the issue.In case of Lift that would mean modifying net/liftweb/util/ Schedule.scala:
private object TF extends ThreadFactory {
val threadFactory = Executors.defaultThreadFactory()
def newThread(r: Runnable) : Thread = {
val d: Thread = threadFactory.newThread(r)
d setName "Lift Scheduler"
d setDaemon true
+ d setContextClassLoader null
d
}
}
No idea what impact this change would have in Jetty and other containers.
Any plans on adding this workaround or rather waiting it out (hoping that Tomcat guys can sort it out)?
See also: http://groups.google.com/group/liftweb/browse_frm/thread/44f4b42115d666d8
Leave a comment