My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 424: init truncates bin/gerrit.war if run from bin/gerrit.war
  Back to list
Status:  Released
Owner:  nsallemb...@google.com
Closed:  Oct 2012


Sign in to add a comment
 
Project Member Reported by sop@google.com, Feb 1, 2010
What steps will reproduce the problem?
1. Copy new version to $site_path/bin/gerrit.war
2. Run bin/gerrit.war init -d $site_path
3. Answer "Y" to copy the WAR file on top of itself.

The file is truncated to 0 bytes, and a subsequent restart
of the server will fail.

If the file we are copying from is the file we are going
to copy into, we shouldn't do the copy at all.

Better, we should use JGit's LockFile class to perform the
update of the WAR, because it won't truncate the destination.
Instead it writes to a temporary file, and then renames that
on top of the destination if the copy is fully successful.
Feb 1, 2010
#1 sop@google.com
We probably should do the same thing with updates of
the gerrit.sh start script.  We also don't want that
to get corrupted if the disk fills up during an upgrade.
Feb 2, 2010
#2 sop@google.com
(No comment was entered for this change.)
Owner: nsallemb...@google.com
Feb 2, 2010
#3 sop@google.com
WAR ovewrite fixed in I32945d4a738ae832850e05d732181d914e2127a7
Status: Fixed
Labels: -Milestone-2.1.2 FixedIn-2.1.2
Oct 21, 2012
#4 sop@google.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting