On Today at 12:11pm, YS=>Yoav Shapira <[EMAIL PROTECTED]> wrote:

YS> [..snip..]
YS> 
YS> You can call it paranoia if you wish, but I prefer caution.  I'm not 
YS> about to go remove a line code in an important component that we know 
YS> is used in several paths through the code (corresponding to several 
YS> different deployment scenarios) and that has been stable for a year 
YS> plus save for the complaints from one user.  I don't believe that 
YS> you're the only user of the tagging feature: simply given the 
YS> demographics of Tomcat adoption, I'd be unlikely to believe any one 
YS> feature only has one user.  It's far more likely that the bug only 
YS> shows up in your particular environment.  No one's contending that 
YS> you're seeing bad behavior, we just think the patch is too general and 
YS> risky as-is.
YS> 

Fair enough. I'll do a test with different CATALINA_HOME and 
CATALINA_BASE.

YS> 
YS> If you want to submit a more precise patch, i.e. one that checks for 
YS> the tag usage and then only circumvents copies if the two files are 
YS> indeed the same exact path (taking symlinks and catalina_base versus 
YS> catalina_home into account), good.  If you want to submit accompanying 
YS> test cases, great.  Both would be gladly welcomed.
YS> 


If I find time, I'll work on the patch, but before I do that, let me show 
my setup with a different CATALINA_BASE and CATALINA_HOME.

This is how I start my tomcat:

env CATALINA_BASE=/www/tomcatbase /www/tomcat/bin/startup.sh

The output comes out as:

Using CATALINA_BASE:   /www/tomcatbase
Using CATALINA_HOME:   /www/tomcat
Using CATALINA_TMPDIR: /www/tomcatbase/temp
Using JRE_HOME:       /opt/sun-jdk-1.5.0.06

As you can clearly see, BASE and HOME are different (and before you ask, 
neither one of them is a symlink :-))

So, I modified ManagerServlet to show some debug output before the 1st 
copy, inserted a Thread.sleep() in the middle and some more debug output 
before the 2nd copy. Here are the results (in catalina.out):

Copying 
/www/tomcatbase/work/Catalina/localhost/manager/some-tag-here/sws.war to
 /www/tomcatbase/webapps/sws.war
Length: 8047722
Copying /www/tomcatbase/webapps/sws.war to /www/tomcatbase/webapps/sws.war
Length: 0

As you can see 2nd copy is trying to copy onto itself. Its not needed!!


YS> Like Filip, I'd -1 the patch as is because it's too general and 
YS> doesn't seem to take into account scenarios where the two paths are 
YS> different so the copy does not result in a zero-sized file.
YS> 


As explained above, the paths cannot be different (even if BASE and HOME 
are different). They can be different if symlinks are used. I will ask 
again who knows what the 2nd copy is doing? And, yet again, I will be told 
its been there for over a year with no complaints. Phew!!!


YS> Yoav
YS> 

Who do you want the feature to work for?

a) People with default configuration
b) People with esoteric configurations that are yet to be discovered

I would guess a) since most people run with CATALINA_HOME and 
CATALINA_BASE as the same. In addition, I have also shown that even if 
CATALINA_HOME and CATALINA_BASE are different the code is still at fault.

Cheers,
--
Haroon Rafique
<[EMAIL PROTECTED]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to