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 A230B77BA for ; Sat, 5 Nov 2011 15:24:43 +0000 (UTC) Received: (qmail 41611 invoked by uid 500); 5 Nov 2011 15:24:42 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 41539 invoked by uid 500); 5 Nov 2011 15:24:42 -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 41530 invoked by uid 99); 5 Nov 2011 15:24:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2011 15:24:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vw0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2011 15:24:36 +0000 Received: by vws17 with SMTP id 17so3824844vws.18 for ; Sat, 05 Nov 2011 08:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=JifYJnOZan10yjuxFx8YCRTP6wr0DF2nwt+cGztRJo4=; b=uTAZI0OTp5m1oKO5wuvmo+/L4B1aSMX+JyywbsuWM7Hn+oaZ1KI3H7IFXvUtBQBPn5 C2IevyG8OVL8IgK+9dwg466e9NpDseUfh1aQwTu+4I8Kgp7AEKBK82LVty8pE+OTEiSa I0osbTnQyFwlM7wiKXSPZWDDrdjrndFbPUO4k= MIME-Version: 1.0 Received: by 10.52.187.65 with SMTP id fq1mr13907875vdc.27.1320506655430; Sat, 05 Nov 2011 08:24:15 -0700 (PDT) Received: by 10.52.114.202 with HTTP; Sat, 5 Nov 2011 08:24:15 -0700 (PDT) In-Reply-To: <4EB31DB2.5000102@apache.org> References: <4EB2CA73.6080908@apache.org> <4EB31DB2.5000102@apache.org> Date: Sat, 5 Nov 2011 19:24:15 +0400 Message-ID: Subject: Re: Redeploy on context.xml changes (Was: Tagging 7.0.23) From: Konstantin Kolinko To: Tomcat Developers List Content-Type: text/plain; charset=ISO-8859-1 2011/11/4 Mark Thomas : > On 03/11/2011 17:08, Mark Thomas wrote: >> I'm still looking at: >> - recovery after fixing the broken file >> - not deploying an expanded dir if the context.xml in >> conf/Catalina/localhost is broken. > > OK. Here is a patch for review. There are so many combinations > deployment and ways to create a dodgy configuration that I have probably > missed a couple of edge cases. > > The main idea with this patch is that a Context always gets added even > if deployment fails. That allows fixes via JMX and prevents > WAR/directory deployment after a failed descriptor deployment. If the > context.xml can't be read, a new FailedContext object is used. This > allows redeploy resources to be tracked but the Context cannot be started. > > A number of clean-up issues I spotted along the way have already been fixed. > > http://people.apache.org/~markt/patches/2011-11-03-redeploy-trunk-v2.patch > http://people.apache.org/~kkolinko/patches/2011-11-05_tc8_redeploy-v3.patch It is just your patch, but - reverted renames of "watched resource" -> "reload resource". (*) - formatted FailedContext.java and added javadoc at the top of it - corrected a typo s/absolue/absolute/ (*) Renaming does not add much, and so it is easier to backport. Let's do not rename WatchedResource -> ReloadResource. As of now: 1) addReloadResource() is not implemented in FailedContext. So there is no way to add dependency on the global conf/context.xml there. Possible solutions, but need to think about them a) store reload resources elsewhere outside of Context b) extract some code from StandardContext into a new class (something like StandardContextBase?) and share it with FailedContext? I see that FailedContext does not inherit from ContainerBase, so maybe there is some trouble with that. c) Copy some code into FailedContext? d) Use StandardContext, but overwrite some methods? 2) It is odd that FailedContext has @SuppressWarnings("unused") public synchronized void addValve(Valve valve) 3) deployer-howto.xml still mentions "RedeployResource". I'd see where it goes and fix later. PS: I had troubles applying your patch with svn and started a thread on users@subversion referring to it as an example. It does not handle the way git denotes added files. Not a big deal when there is only one added file - it us easy to handle that. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org