When given a war file in the command line, Winstone tries to check if the temporary exploded war directory is in sync with the war file, and skip the extraction when possible.
Unfortunately, this algorithm is broken for typical use cases, as discussed in https://hudson.dev.java.net/issues/show_bug.cgi?id=1408
Say you have two war files of the same name "hudson.war" v1 and v2, and they are built on Jan and Feb respectively.
Now let's assume that it's March now, and the user installed v1. Now if he attempts to run v2, Winstone won't explode files because the extraction date of Mar is newer than Feb, but this is not what the user expected.
Similarly, if the user installed v2 first and then attempt to downgrade to v1, that fails too.
What's necessary is not to compare which is newer, but to create a timestamp file and make sure its timestamp is the same as the timestamp of the war. I attached a patch to do this.
It would be even more robust if we also check the size of the war file, but in practice timestamp is probably good enough.
Log in to post a comment.