Assume
A tomcat container running a web app.
Fire a tomcat shutdown command.
In my case the tomcat container does not shutdown as there are task threads that remain after shut down command was fired.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unless there is magic in Tomcat that I’m not aware of (possible), the issue is probably that your sleeping threads are not daemon threads. Once the JVM shutdown is initiated (via external HUP/INT/TERM signal, or System.exit or whatever other means) the JVM will wait around until all non-daemon threads complete normally. You’ll need to arrange for your sleeping threads to have an orderly shutdown, or set daemon=true when they are created.