Author: markt Date: Sun Sep 9 15:25:05 2012 New Revision: 1382516 URL: http://svn.apache.org/viewvc?rev=1382516&view=rev Log: Review comments from kkolinko
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1382515 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1382516&r1=1382515&r2=1382516&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java Sun Sep 9 15:25:05 2012 @@ -1457,7 +1457,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<String> sortedAppNames = new TreeSet<String>(); sortedAppNames.addAll(deployed.keySet()); @@ -1472,11 +1472,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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org