framework
framework copied to clipboard
Scheduler leaking thread pools
It seems that the interaction between LiftSession
and Schedule
is causing thread pools to leak at shutdown time. I've been seeing this at shutdown time with Tomcat; Schedule.shutdown
seems to be called when the servlet is destroyed, but shutDownAllSessions
for LiftSession
is running asynchronously somewhere else. The way Schedule
is implemented, it looks like its backing threadpool is re-created in this case, but then nothing is responsible for shutting it down again. In the best case, this causes the pool to be leaked, in the worst case, it prevents Tomcat (and probably other containers) from shutting down gracefully, since they're not daemon threads.
I brought this up on the mailing list, and it sounds like it is indeed a bug, though I'm skeptical that the proposed solution on the mailing list will be adequate (as I mentioned in that thread).