You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/09/12 16:59:58 UTC

Servlet Redeployment in Production

What does Tomcat do when, in production, a new version of a WAR file that's
currently being accessed is deployed? I've heard generally that you don't
enable the auto-deployment feature in production, but assume you're aiming
for a five-nines environment and the requirement is hot redeployment of the
application.

So here's the scenario: users are accessing a given context continually. An
administrator literally drops into the webapps folder a new WAR file with
the same name as the context above. What happens from a technical
perspective, in terms of synchronization, consistency of existing sessions
that were on the old webapp, and much more?

Before spoiling the surprise for me, can anyone point me to the relevant
classes/methods in the Tomcat source code to take a look at? (Then when I
can't figure it out, I'll come back and ask you to spoil the surprise :) I'd
like to get better at looking through a code base and figuring these things
out, so hopefully someone can guide me in this.

Thanks.
-- 
View this message in context: http://www.nabble.com/Servlet-Redeployment-in-Production-tf4429878.html#a12637399
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Servlet Redeployment in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

lb,

lightbulb432 wrote:
> 
> 
> Christopher Schultz-2 wrote:
>> I would argue that autodeploy doesn't help much in this case, but we'll
>> stick with that assumption for this discussion.
> 
> I realize it wouldn't help for things like database changes, but what about
> changes to the structure of the HttpSession map, or the cookie structure, or
> something that has to do at the web application?

I just meant that auto-deployment doesn't really help with uptime.

I'm not sure I understand your follow-up question.

>> I'd start with org.apache.catalina.StandardContext (and, specifically,
>> the "reload" method), since that's the thing being reloaded.
> 
> Where could I find the code where Tomcat stores its definitive list of all
> the current, active HttpSessions? (Where's the structure that Tomcat adds a
> newly created HttpSession to, and from which it removes timed-out or
> invalidated HttpSessions, and the code that manipulates it?)

You should just download the code and start looking around. It's not
hard to follow the action starting from what happens when the request
has getSession() called.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG7+v39CaO5/Lv0PARAjpaAJ9qSQj2cPj/8Fkq4x0m/jDVdwMNUQCfUCKX
zbmwNMNJxlZs3lNXwtXS7+M=
=K2AX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Servlet Redeployment in Production

Posted by lightbulb432 <ve...@hotmail.com>.


Christopher Schultz-2 wrote:
> 
>> What does Tomcat do when, in production, a new version of a WAR file
>> that's
>> currently being accessed is deployed? I've heard generally that you don't
>> enable the auto-deployment feature in production, but assume you're
>> aiming
>> for a five-nines environment and the requirement is hot redeployment of
>> the
>> application.
> 
> I would argue that autodeploy doesn't help much in this case, but we'll
> stick with that assumption for this discussion.

I realize it wouldn't help for things like database changes, but what about
changes to the structure of the HttpSession map, or the cookie structure, or
something that has to do at the web application?


I'd start with org.apache.catalina.StandardContext (and, specifically,
> the "reload" method), since that's the thing being reloaded.

Where could I find the code where Tomcat stores its definitive list of all
the current, active HttpSessions? (Where's the structure that Tomcat adds a
newly created HttpSession to, and from which it removes timed-out or
invalidated HttpSessions, and the code that manipulates it?)
-- 
View this message in context: http://www.nabble.com/Servlet-Redeployment-in-Production-tf4429878.html#a12758041
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Servlet Redeployment in Production

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lb,

lightbulb432 wrote:
> What does Tomcat do when, in production, a new version of a WAR file that's
> currently being accessed is deployed? I've heard generally that you don't
> enable the auto-deployment feature in production, but assume you're aiming
> for a five-nines environment and the requirement is hot redeployment of the
> application.

I would argue that autodeploy doesn't help much in this case, but we'll
stick with that assumption for this discussion.

> So here's the scenario: users are accessing a given context continually. An
> administrator literally drops into the webapps folder a new WAR file with
> the same name as the context above. What happens from a technical
> perspective, in terms of synchronization, consistency of existing sessions
> that were on the old webapp, and much more?

Reading the code would provide a much better explanation that one of us
essentially regurgitating the code as pseudocode.

> Before spoiling the surprise for me, can anyone point me to the relevant
> classes/methods in the Tomcat source code to take a look at? (Then when I
> can't figure it out, I'll come back and ask you to spoil the surprise :) I'd
> like to get better at looking through a code base and figuring these things
> out, so hopefully someone can guide me in this.

I'd start with org.apache.catalina.StandardContext (and, specifically,
the "reload" method), since that's the thing being reloaded.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG6Ai89CaO5/Lv0PARAmUXAJ0ZH4w0pCfbK4WYjS4u8WGmzdiNCACfXIKt
xH8cv24QlAvSfAyP7TXhxtY=
=Dtc3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org