Grails:Tomcat不会在产品中干净地关闭 [英] Grails: Tomcat won't shut down cleanly in prod
问题描述
我在关闭生产中的Grails应用时遇到了问题。
从IntelliJ运行时,它会完全关闭。但是,在独立的Tomcat 7上,关闭将其置于僵尸状态,即java进程仍然存在但HTTP请求挂起。我必须杀死java进程(使用kill)。
我使用Tomcat的标准bin / startup.sh和shutdown.sh。在Tomcat停止的情况下,我将.war放入Tomcat的/ webapps目录,然后启动。
我怀疑它可能是Quartz job scheduler插件,但我部署了一个版本在grails-app / jobs中没有任何工作,它仍然挂起。
以前有人跑过这个吗?感谢!
非守护线程
可能有一个或多个非守护线程仍在运行,并阻止tomcat成功关闭。
$ b
ps -ef | grep java
并找到Tomcat7 p_id
kill -3 p_id
tail -200 logs / catalina.out
kill -3
I have an issue with shutting down a Grails app in production.
It shuts down cleanly when running from IntelliJ. But on a standalone Tomcat 7, shutting down gets it into a zombie state where the java process still exists but HTTP requests hang. I have to kill the java process (using kill).
I'm using Tomcat's standard bin/startup.sh and shutdown.sh. With Tomcat stopped, I drop the .war into Tomcat's /webapps directory and then start.
I suspect it could be the Quartz job scheduler plugin, but I deployed a version with no jobs in grails-app/jobs and it still hangs.
Anybody run across this before? Thanks!
Non-Daemon Threads
Probably one or more non-daemon thread is still running and preventing tomcat from a successful shutdown.
- open Terminal and type
ps -ef| grep java
and find your Tomcat7 p_id - type
kill -3 p_id
- type (in your Tomcat directory)
tail -200 logs/catalina.out
- inspect thread dump generated by the
kill -3
- look for non-daemon threads
- inspect your code to determine why that process is still alive.
这篇关于Grails:Tomcat不会在产品中干净地关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!