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 C9CC7D1CA for ; Mon, 10 Sep 2012 06:32:37 +0000 (UTC) Received: (qmail 85697 invoked by uid 500); 10 Sep 2012 06:32:37 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 85307 invoked by uid 500); 10 Sep 2012 06:32:32 -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 85282 invoked by uid 99); 10 Sep 2012 06:32:32 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 06:32:32 +0000 Received: from localhost (HELO mail-iy0-f173.google.com) (127.0.0.1) (smtp-auth username kfujino, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 06:32:31 +0000 Received: by iakx26 with SMTP id x26so1871500iak.18 for ; Sun, 09 Sep 2012 23:32:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.77.164 with SMTP id t4mr9410599igw.7.1347258751065; Sun, 09 Sep 2012 23:32:31 -0700 (PDT) Received: by 10.64.30.41 with HTTP; Sun, 9 Sep 2012 23:32:30 -0700 (PDT) In-Reply-To: <20120908211148.17357238897F@eris.apache.org> References: <20120908211148.17357238897F@eris.apache.org> Date: Mon, 10 Sep 2012 15:32:30 +0900 Message-ID: Subject: Re: svn commit: r1382367 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ webapps/docs/ webapps/docs/config/ From: Keiichi Fujino To: Tomcat Developers List Content-Type: text/plain; charset=ISO-8859-1 > > /** > + * 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() { > + // Need ordered set of names > + SortedSet sortedAppNames = new TreeSet(); > + sortedAppNames.addAll(deployed.keySet()); > + > + if (sortedAppNames.size() < 2) { > + return; > + } > + Iterator iter = sortedAppNames.iterator(); > + > + ContextName previous = new ContextName(iter.next()); > + do { > + ContextName current = new ContextName(iter.next()); > + > + if (current.getPath().equals(previous.getPath())) { > + // Current and previous are same version - current will always > + // be a later version > + Context context = (Context) host.findChild(previous.getName()); > + if (context != null) { > + Manager manager = context.getManager(); > + if (manager != null && manager.getActiveSessions() == 0) { manager.getActiveSessions() returns the various numbers of sessions according to the kind of Manager. 1. In BackupManager, manager.getActiveSessions() returns the number of a primary and backup sessions. A proxy session is not contained. Thus manager only with a proxy session will be deleted. (e.g. manager which newly joined in the cluster has only a proxy session.) It is necessary to call DistributedManager#getActiveSessionsFull() instead of manager.getActiveSessions(). 2. In PersistentManage, it may be necessary to take into consideration also about the session saved in Store. It should be deleted only when both manager.getActiveSessions() and Store#getSize are 0. Although it is possible to add these two cases, It seems that it is better to define method which checks number of sessions in a Manager/ManagerBase. -- Keiichi.Fujino --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org