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!
Probably one or more non-daemon thread is still running and preventing tomcat from a successful shutdown.
ps -ef| grep java
and find your Tomcat7 p_id
kill -3 p_id
tail -200 logs/catalina.out
kill -3
I agree with Kerem Baydoğan. There's likely a non-daemon thread which doesn't want to stop. A thread dump is a great way to track this down.
I would recommend connecting to your remote JVM using VisualVM. This has been an invaluable tool for me to gather information about my running applications. If you're on a Mac, it's installed as part of the OS already. From a terminal, just type 'jvisualvm'. If not on a Mac, it's a free download from http://visualvm.java.net/
Once installed, you may need to add a few JVM args to allow the remote connection. http://visualvm.java.net/jmx_connections.html
Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With