-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Vimal,
On 8/9/13 1:01 AM, Vimal Jain wrote: > I am using tomcat-6 on my Ubuntu 13.10 desktop. My question is :- > When i run shutdown script of tomcat , does tomcat wait for > currently running threads to complete before shutting down ? Do you mean "does Tomcat complete all in-progress requests before shutting down"? Honestly, I get horribly confused whenever I try to read the Connector/Processor/Protocol/Lifecycle/etc. code (as I just did, again), but it looks like Tomcat closes the ServerSocket (which will drop any request that hasn't yet been accepted -- those in the TCP accept queue) immediately. I have to imagine that any in-progress non-asynchronous requests that have been assigned threads will complete successfully, since they threads are being managed by a thread pool. I'm not sure what happens to asynchronous requests that are still in mid-flight. Note that running 'bin/catalina.sh stop' does not stop Tomcat before it exists. That command merely sends a "SHUTDOWN" command to Tomcat via a socket (under the default configuration) or sends a signal to the process (if you have changed the default). In the former case (SHUTDOWN command), your shutdown-request completes almost immediately, while the true server process goes through an orderly shutdown process as (lightly) described above. In the latter case (signal), a KILL signal is sent and your JVM might not shutdown in an orderly way -- and you may destroy in-process requests. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJSBO1YAAoJEBzwKT+lPKRYXMEQALpeFF12SE3Cm9DoVwtjlgKb MFef+u54uzRqyRufoamHnO6rbqLd4OPNQIiSbx/eJ2Xr3QQhhF5THRSfQY6hJpxN phxKRWoPVQiEGffo/qXFOmGM10tUbTe1BTD2ZKfUoqy6N4G1EDeUhuEBke2yaBga G5CUcjSYAPqRUMHcQi+EH+8oVGAB3TFXkQAl9a2zz4CqLi8fP/GVeMl8DAN91kCG 0IV6qSw8s6TdC5f3HXtOrp1fEhS15PPdF6gPfBFpKII2IFddGfDwghDhSaabWBrV Q1rMqngNKLArTcXOv4ahXsBAykNaUq2MLLFs2NW2Giy61q9LZ5W5Ip1sa7TqEAU6 hiZU7VDkbrjz3iMLe2UvfoiIi+6P5CAfTL1tKVdGkAo4bN1EwZDShD9hQjvLnJFU 9ScaHfsor0iTwu1UvKjOWER8jids3ntju8kXsGs+WA4SOn517q7Ni0/3DPYkTZQL idQHx8VC0GaENkPQfWRU+CCH73GuWuSKmgWrDnL3mxFNoCPZLFix7fwYBk+5OOSn PeIs0OYhWlMyWj+wNtp7hqx4Bk7XvNKxwpCID+keB8Ffj8JR5hKyKBbJBzCw3RRa YLSaqjCvsq0Ab7k9IyDntH9lVPLRvpxb/d16PZw11IvMlQsbg5KZRSXnXZNabkSf atnhsLEmjGu3fPs8+Ror =ZQGX -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org