Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 75694 invoked from network); 1 Jan 2005 23:10:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Jan 2005 23:10:30 -0000 Received: (qmail 74845 invoked by uid 500); 1 Jan 2005 23:10:10 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 74250 invoked by uid 500); 1 Jan 2005 23:10:08 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 74230 invoked by uid 99); 1 Jan 2005 23:10:08 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from web60202.mail.yahoo.com (HELO web60202.mail.yahoo.com) (216.109.118.97) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 01 Jan 2005 15:10:04 -0800 Received: (qmail 92077 invoked by uid 60001); 1 Jan 2005 23:10:02 -0000 Message-ID: <20050101231002.92075.qmail@web60202.mail.yahoo.com> Received: from [220.233.71.22] by web60202.mail.yahoo.com via HTTP; Sun, 02 Jan 2005 10:10:02 EST Date: Sun, 2 Jan 2005 10:10:02 +1100 (EST) From: Brett Randall Subject: Re: Scripted shutdown does not force JVM exit To: Tomcat Users List Cc: funkman@joedog.org, qm300@brandxdev.net In-Reply-To: <41D6A7BB.9040406@joedog.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Tim, QM, thanks for your replies. Tim Funk: > Calling System.exit() has been discussed on tomcat-dev and by vetoed. Yes, thanks, I subsequently found zilla 17000 and the discussion. Tim Funk: > If the JVM does not shut down - it is due to bad 3rd party code which creates non-daemon threads and fail to detect a shutdown. As put in my original post, I totally agree that it is bad form by the webapp to start a long-running Thread and not shut it down during its own shutdown. QM: > I'd disagree; it puts responsibility on developers and architects to make sure their applications handle threads properly. Yes, responsibility has been placed on developers and architects, but a Tomcat admin who deploys applications may not be in a position to hold them all individually to account. Tim Funk: > Then if you need to kill the JVM - just "kill -9 `cat $CATALINA_PID`" Yes, bearing in mind that SIGKILL is a very blunt instrument. It will prevent the JVM from running any shutdown hooks or finalizers. SIGHUP seems to work OK on Linux, but the way the JVM responds to signals from the OS seems to vary. For this reason, I think "killing from the outside" is bad and should be avoided if at all possible. QM: > There's no need for a container to compensate for poor design. =) Agreed, but wouldn't you agree that said poor design of a webapp should not cause (unnecessary) problems with administration of the container? Important to remember that not all Tomcat admins write the webapp code. Source code is often not available. I think this can be argued from the other perspective: the container is already compensating for poor design in the webapp, by allowing stray threads to continue running. Shutdown means shutdown, which should give the container the right to terminate the JVM, no? *** Note that the shutdown sequence in a default 3.2.x jBoss deployment does finally shutdown the JVM. +1 for the (configurable) enhancement described in 17000, based on the fact that System.exit(0) is better than "killing from the outside", in circumstances beyond the Tomcat Administrator's control (when a webapp misbehaves by leaving unterminated threads). I see no good reason to delegate this part of the shutdown sequence to the operating system. Happy to see any arguments for -1. Regards Brett Randall Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org