tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: Patch suggestion
Date Sat, 10 Apr 2010 23:17:45 GMT
2010/4/10 Pid <>:
> In lieu of of a Bugzilla enhancement (and hoping that I have the right end
> of the stick).

If I guess your intention correctly,
you want to prevent deployment of a war file that is still open for writing?

If that is the case, then asking for modification time probably will
not work. The file properties in the file system are usually not
updated that frequently. Though that might differ between OSes. Also,
if the file is being transmitted over network, the update frequency
depends on how fast is the connection that is used to upload the file.

As far as I remember my experience, I think that a file that is still
being written can be detected by asking its length. Such files can be
listed by shell to be of length 0.

Needs more research and some summary across OSes though.

At least, if the war file is of length 0 it can be safely skipped for
obvious reasons.

>                try {
>                    Thread.sleep(500);
>                }

I do not like unconditionally sleeping for every file. 20 wars = 10
seconds to sleep, even if none of them is going to be deployed

Time could be compared against the interval between autoDeploy cycle
runs, if it is enabled, but there are also explicit calls from the
manager web application that must not be broken.

The above is from my mind/memory. I have not researched it for this case.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message