tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ellecer Valencia <elle...@gmail.com>
Subject Re: Rollback in Tomcat7 under parallel deployment
Date Thu, 27 Oct 2011 23:11:38 GMT
On Thursday, October 27, 2011, Mark Thomas <markt@apache.org> wrote:
>> Also, what happens if ROOT##001 and ##002 have the same log4j configs
>> and are writing to the same log file?? How have people handled this
>> situation?
>
> You'll certainly end up with both apps writing to the same file. Whether
> or not that is a problem will depend on exactly how you have configured
> logging. See [1] for other things to think about.

Looks like it's something that shouldn't be allowed to occur, at least under
log4j.

http://logging.apache.org/log4j/1.2/manual.html

"... image of the log4j environment will act independetly and without any
mutual synchronization. For example, FileAppenders defined exactly the same
way in multiple web-application configurations will all attempt to write the
same file. The results are likely to be less than satisfactory. You must
make sure that log4j configurations of different web-applications do not use
the same underlying system resource."

Logback supports writing to the same file, but at the cost of 3x slower
performance:

http://logback.qos.ch/manual/appenders.html#prudent

But that entails even more changes in our code, so we'll have to have a
workaround. (i guess we could replace log4j.jar with log4j-over-slf4j.jar
then use logback! http://www.slf4j.org/legacy.html)

>> thanks for you help,
>
> A better way to handle the rollback scenario is to deploy a copy of
> ROOT##001.war as ROOT#003.war.

That's the first option we saw, but just wanted to confirm that there wasn't
another rollback feature similar to parallel deployment. I guess in a
rollback scenario it's probably more prudent to just end those sessions
since the app is broken anyway. The idea of "parallel rollback" hurts my
head just imagining how it would be implemented! =)

Ellecer

>
> Mark
>
> [1] http://java-monitor.com/forum/showthread.php?t=1288

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message