Tomcat doesn't stop. How can I debug this?

后端 未结 7 740
旧时难觅i
旧时难觅i 2020-12-03 06:29

I have a Tomcat 7 running in Linux that I start via $CATALINA_HOME/bin/startup.sh and shutdown via $CATALINA_HOME/bin/shutdown.sh

相关标签:
7条回答
  • 2020-12-03 07:26

    Find out what threads are still running (or blocked, waiting to run) by using jstack or sending a signal to the process:

    kill -3 pid
    

    When you know this, you can make whatever it was that started them hook into the shutdown notification to stop the threads. Or make those threads deamon threads.

    See This tomcat shutdown question for more details on this.

    If you don't know where your threads were created, then consider adding names to them - executors can take thread factories, and you can use those factories to set the deamon status of a thread and also to name it - so your stack trace will be clearer.

    0 讨论(0)
提交回复
热议问题