tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett Randall" <>
Subject Scripted shutdown does not force JVM exit
Date Sat, 01 Jan 2005 08:45:52 GMT
I've noticed that Tomcat's scripted/orderly shutdown does not force the
JVM to exit.  After running all lifecycle events, the main thread just
"falls-through" rather than calling exit(0) to end the JVM.

I'm wondering if this is intentional?  The result is that any
application-spawned Thread-s that are not well managed (i.e. are allowed
to continue to run or block after the context is removed) continue to
run, and the JVM does not exit.

This presents a problem for application deployers, when faced with
applications that spawn threads and do not clean them up.  The only
shutdown option in these cases is to send a SIGINTR to the JVM, as the
scripted shutdown does not call exit.

Is there a major problem with having the Tomcat shutdown sequence make a
final call of System.exit(0), perhaps as a configurable option?  I think
that if the intention is to shutdown the container, it makes sense that
any (now defunct) threads that applications spawned also end.  I suppose
that this would be a problem for anyone who runs Tomcat in a shared JVM.

Opinions please.

Brett Randall

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message