Hi All,
I'm working on a project using Lift 2.5. We're having issues with Tomcat not shutting down cleanly when being sent a shutdown signal. After a bit of digging, everything seems to point at net.liftweb.util.Schedule as the culprit; specifically, the behavior where it creates a new ThreadPoolExecutor if the old one was shut down.
We've tried Lift 2.6.2, and the problem remains (which makes sense, since the code in question appears to be the same). I compiled a copy of 2.6.2 with some logging added whenever a new pool is created in Schedule, and it is indeed creating a new one at shutdown time. It appears that what's happening is that Schedule.shutdown is called, while LiftSession.shutDownAllSessions is running asynchronously someplace. Shutting down a session uses Schedule to send a shutdown message to any comet actors associated with that session, causing a new pool to be spun up (since the old is already shut down), and now there's nothing hanging around to shut that pool down. The threadpool is effectively leaked and will hold up a graceful shutdown of Tomcat, since they're not daemon threads. It'll also leak in the case that the webapp is stopped and restarted without restarting Tomcat.
Is this an issue anyone else has observed? Are there any known workarounds or bugfix releases addressing the issue?