You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/11/21 17:46:29 UTC

DO NOT REPLY [Bug 46263] New: Tomcat reloading of context does not update context path

https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

           Summary: Tomcat reloading of context does not update context path
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: joe@k12s.phast.umass.edu


Tomcat reloading of context does not update context path

Several years ago I worked on integrating tomcat 5.5 into our web application
management infrastructure.  During the process I fixed several tomcat 5.5 bugs,
but apparently never sent the fixes upstream.  Oops.

Our application environment requires that we be able to upgrade to a newer
version of code for our application without loosing any webrequests.  One major
obstacle was fixed with Bug #43683.  Another obstacle is the changing of the
docBase of the context itself during the reload.

If you are running in autoDeploy="false" mode, and you start a context (EG:
visit the url of one of the servlets), if you update the docBase in the context
xml file on disk, and then reload that context using the tomcat-hostmanager
app:
w3m http://localhost:8180/tomcat-manager/reload?path=/thecontext

The context will reload, however the new docBase will not be respected.  It
will reload the original docBase.

If you tomcat-manager/stop then tomcat-manager/start, your updates will be
respected, but the transfer to the new docBase is not atomic (you will loose
requests).

If you run in autoDeploy="true" mode, the new docBase will be respected,
however the transfer to the new docBase is not atomic (you will loose
requests).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 46263] Tomcat reloading of context does not update context path

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

--- Comment #3 from Joe Kislo <jo...@k12s.phast.umass.edu> 2010-11-29 15:07:33 EST ---
I can confirm my patch still works on Tomcat 6.0.29

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

--- Comment #8 from Christopher Schultz <ch...@christopherschultz.net> ---
Your patch looks okay to me with one minor exception: it would be better to use
the StringManager for strings instead of hard-coded ones. Look for uses of
"sm.getString" for examples.

On the other hand, I'm not sure how it makes much of a difference to deploy
MY-GREAT-APP-v1.2.3.4.war instead of MY-GREAT-APP#1.2.3.4.war.

Also, if I'm not mistaken, the patch you have written does not allow for
parallel deployment: it will essentially perform an undeploy/redeploy. During
the "reload", clients will experience at least a pause.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
If you want to re-name the context AND install a new copy of it, why not just
deploy a completely new copy of the webapp on the new context path, then
undeploy the old one at your leisure?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

--- Comment #7 from Joe Kislo <jo...@gmail.com> ---
Created attachment 31039
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31039&action=edit
7.0.42 patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Tomcat reloading of context |Tomcat reloading of
                   |does not update context     |context.xml does not update
                   |path                        |docBase

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 46263] Tomcat reloading of context does not update context path

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263





--- Comment #1 from Joe Kislo <jo...@k12s.phast.umass.edu>  2008-11-21 08:48:47 PST ---
The solution I provide is to allow an additional parameter to the /reload
request.  The patch I have provided allows you to supply a 
&war=/path/to/my/new/docPath

parameter, which if supplied, will replace the docpath atomically during the
reload process.

This request could also be fulfilled by actually reloading the context file off
of disk, but I was worried that somebody may change more than just the docPath,
and I do not know the ramifications of other things being changed in the
context file during a reload.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
This feature request is covered by parallel deployment available in Tomcat 7
onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 46263] Tomcat reloading of context does not update context path

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263





--- Comment #2 from Joe Kislo <jo...@k12s.phast.umass.edu>  2008-11-21 08:50:33 PST ---
Created an attachment (id=22911)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22911)
Proposed Patch


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 46263] Tomcat reloading of context.xml does not update docBase

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46263

Joe Kislo <jo...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #6 from Joe Kislo <jo...@gmail.com> ---
To answer Christopher Schultz:
  We are try to upgrade a web application from one build to a newer build, so
we would want to use the same URL, but with the newer version of the
application, and we do not want to loose any requests when the transition is
happening.  So we can't undeploy and redeploy.

To answer Mark Thomas:
  We looked into the parallel code deployment feature of Tomcat 7, and it is a
very clever way to solve this issue.  I suspect it will be sufficient for most
people.  However in our case we do need fine-grained control of the starting
and stopping of a specific version of the application.  We handle long-running
requests in a special manner in the servlet destroy() and we know the new code
is not deployed prior to them being serviced or 'dealt with'.  We also
synchronize code upgrades with other non-servlet deployments of the code base,
so having 'old' or 'unknown' versions of the servlet running out there is not
something that works for us.  Our deployment mechanism communicates with a
number of different components, tomcat being just one, and knowing the specific
state of each server is important.

I am reopening this bug/feature request, because I believe it is beneficial for
tomcat to have this capability, and it is a capability present in the
application server we migrated from (and I suspect is a common capability in
other application servers).  I am attaching an updated patch that applies to
Tomcat 7.0.42.  

Mark, if your opinion Tomcat is better without this capability, feel free to
re-close as wontfix and I won't be offended.  :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org