From 25a103f9f5b40562aadeff80eddc24c282607a72 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 27 Sep 2012 19:08:47 +0100 Subject: [PATCH] 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 --- maintenance/cleanupUploadStash.php | 2 ++ 1 file changed, 2 insertions(+) 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" ); -- 2.20.1