Grails:Tomcat不会在产品中干净地关闭 [英] Grails: Tomcat won't shut down cleanly in prod

查看:98
本文介绍了Grails:Tomcat不会在产品中干净地关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在关闭生产中的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

  • 类型(在Tomcat目录中) 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆