Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A153D2BF for ; Sun, 9 Sep 2012 15:23:57 +0000 (UTC) Received: (qmail 80628 invoked by uid 500); 9 Sep 2012 15:23:56 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 80564 invoked by uid 500); 9 Sep 2012 15:23:56 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 80551 invoked by uid 99); 9 Sep 2012 15:23:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 15:23:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 15:23:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 58FFB23888FE for ; Sun, 9 Sep 2012 15:23:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1382515 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Date: Sun, 09 Sep 2012 15:23:10 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120909152310.58FFB23888FE@eris.apache.org> Author: markt Date: Sun Sep 9 15:23:09 2012 New Revision: 1382515 URL: http://svn.apache.org/viewvc?rev=1382515&view=rev Log: Review comments from kkolinko Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1382515&r1=1382514&r2=1382515&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Sun Sep 9 15:23:09 2012 @@ -1404,7 +1404,7 @@ public class HostConfig * Check for old versions of applications using parallel deployment that are * now unused (have no active sessions) and undeploy any that are found. */ - public void checkUndeploy() { + public synchronized void checkUndeploy() { // Need ordered set of names SortedSet sortedAppNames = new TreeSet<>(); sortedAppNames.addAll(deployed.keySet()); @@ -1419,11 +1419,16 @@ public class HostConfig ContextName current = new ContextName(iter.next()); if (current.getPath().equals(previous.getPath())) { - // Current and previous are same version - current will always + // Current and previous are same path - current will always // be a later version - Context context = (Context) host.findChild(previous.getName()); - if (context != null) { - Manager manager = context.getManager(); + Context previousContext = + (Context) host.findChild(previous.getName()); + Context currentContext = + (Context) host.findChild(previous.getName()); + if (previousContext != null && currentContext != null && + currentContext.getState().isAvailable() && + !isServiced(previous.getName())) { + Manager manager = previousContext.getManager(); if (manager != null && manager.getActiveSessions() == 0) { if (log.isInfoEnabled()) { log.info(sm.getString("hostConfig.undeployVersion", --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org