Closed GoogleCodeExporter closed 8 years ago
Original comment by mgron...@gmail.com
on 18 Jul 2008 at 9:10
r899 | mgronber | 2008-08-06 14:17:01 -0700 (Wed, 06 Aug 2008) | 16 lines
I've tested on Linux with this patch and it seems to shutdown every time.
In the WorkQueue.shutdown() method, it interrupts all the WorkThreads and tries
to shutdown the LifeThread but it never really waits for the LifeThread to be
done. On top of this, it does not remove any of the interrupted threads from
the 'threads' HashSet. Therefore, if the LifeThread happens to be in the wait()
state when shutdown is called (which is very likely), it will check the status
of all the threads in the 'threads' HashSet. If it gets a chance to run before
the Tomcat server is shutdown and the JVM exits, then it will restart all the
interrupted WorkThreads and the Tomcat server will not be able to exit.
This change basically kills the LifeThread and makes sure it is killed before
taking care of all the WorkThreads. It also moves the wait down to the end of
the LifeThread run loop so the state of the 'shutdown' field is checked
instantly before any work is done.
Original comment by mgron...@gmail.com
on 6 Aug 2008 at 9:31
Original comment by jl1615@gmail.com
on 12 Jan 2009 at 3:30
Original issue reported on code.google.com by
jl1615@gmail.com
on 2 Jul 2008 at 11:08