From: Reedy Date: Thu, 27 Sep 2012 18:08:47 +0000 (+0100) Subject: Catch and deal with UploadStashZeroLengthFileException when removing stashed files X-Git-Tag: 1.31.0-rc.0~22247^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=25a103f9f5b40562aadeff80eddc24c282607a72;p=lhc%2Fweb%2Fwiklou.git Catch and deal with UploadStashZeroLengthFileException when removing stashed files Seen on the cluster and it halts script execution reedy@fenari:/home/wikipedia/common$ mwscript cleanupUploadStash.php commonswiki Getting list of files to clean up... Removing 52958 file(s)... File is zero length Backtrace: Change-Id: I740111ca20473c495a4a51edafa156169fe6dd4d --- diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 99985b5e3a..6afe9e11e0 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -84,6 +84,8 @@ class UploadStashCleanup extends Maintenance { $stash->removeFileNoAuth( $key ); } catch ( UploadStashBadPathException $ex ) { $this->output( "Failed removing stashed upload with key: $key\n" ); + } catch ( UploadStashZeroLengthFileException $ex ) { + $this->output( "Failed removing stashed upload with key: $key\n" ); } if ( $i % 100 == 0 ) { $this->output( "$i\n" );