Re: Tomcat 6 graceful shutdown
On 21/03/2011 02:15, Igor Cicimov wrote: Hi, I'm running Tomcat 6.0.26 on Solaris 10 and have a question about what exactly happens during Tomcat graceful shutdown? I guess first thing it does is stop accepting new sessions on the listening ports. Sessions aren't received on ports, requests are. just for the servelets to finish their current requests? New requests are not processed. Existing requests are allowed to continue. What happens exactly with the servlets and the threads? In general, how the threads and servlets are being destroyed during graceful shutdown? Servlets are given a short time to complete and if they don't the JVM shuts down anyway. Since they run on daemon threads those threads will be forcibly stopped by the JVM during shutdown. Application generated threads should be stopped by the application. When I issue the following command from the unix shell: # $TOMCAT_HOME/bin/catalina.sh stop 600 I can still see the server being shut down in less than 10 seconds although I specify 10 minutes delay. Does that mean that the server has already shut down all the resources properly and doesn't have to wait for 10 minutes? Yes. Is the unloadDelay specified in the application Context the only wait of controlling the shutdown process (the servlet unload time)? Yes. How can I make sure that all the requests finish before the server shutdown? Make sure they always complete in less than unloadDelay. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 graceful shutdown
Hi Mark, Thanks for your reply. I guess this means that if Tomcat hangs during shutdown then something is wrong with the application and it can't close the threads? What can I do to trouble shoot this and find exactly where the problem is? (except taking stack trace on the hanged process of course) Igor On Mon, Mar 21, 2011 at 8:07 PM, Mark Thomas ma...@apache.org wrote: On 21/03/2011 02:15, Igor Cicimov wrote: Hi, I'm running Tomcat 6.0.26 on Solaris 10 and have a question about what exactly happens during Tomcat graceful shutdown? I guess first thing it does is stop accepting new sessions on the listening ports. Sessions aren't received on ports, requests are. just for the servelets to finish their current requests? New requests are not processed. Existing requests are allowed to continue. What happens exactly with the servlets and the threads? In general, how the threads and servlets are being destroyed during graceful shutdown? Servlets are given a short time to complete and if they don't the JVM shuts down anyway. Since they run on daemon threads those threads will be forcibly stopped by the JVM during shutdown. Application generated threads should be stopped by the application. When I issue the following command from the unix shell: # $TOMCAT_HOME/bin/catalina.sh stop 600 I can still see the server being shut down in less than 10 seconds although I specify 10 minutes delay. Does that mean that the server has already shut down all the resources properly and doesn't have to wait for 10 minutes? Yes. Is the unloadDelay specified in the application Context the only wait of controlling the shutdown process (the servlet unload time)? Yes. How can I make sure that all the requests finish before the server shutdown? Make sure they always complete in less than unloadDelay. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6 graceful shutdown
From: Igor Cicimov [mailto:icici...@gmail.com] Subject: Re: Tomcat 6 graceful shutdown What can I do to trouble shoot this and find exactly where the problem is? (except taking stack trace on the hanged process of course) Taking a thread dump is pretty much the only way. Other than perhaps a thorough code inspection of the webapp... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 6 graceful shutdown
Hi, I'm running Tomcat 6.0.26 on Solaris 10 and have a question about what exactly happens during Tomcat graceful shutdown? I guess first thing it does is stop accepting new sessions on the listening ports. Sessions only or it stops accepting new requests from the already established sessions? Does it wait for the current sessions to end (I don't think so since this might take very long time) or just for the servelets to finish their current requests? What happens exactly with the servlets and the threads? In general, how the threads and servlets are being destroyed during graceful shutdown? When I issue the following command from the unix shell: # $TOMCAT_HOME/bin/catalina.sh stop 600 I can still see the server being shut down in less than 10 seconds although I specify 10 minutes delay. Does that mean that the server has already shut down all the resources properly and doesn't have to wait for 10 minutes? Is the unloadDelay specified in the application Context the only wait of controlling the shutdown process (the servlet unload time)? How can I make sure that all the requests finish before the server shutdown? Thank you very much for your help.