From: Aaron Schulz Date: Mon, 19 May 2014 22:18:01 +0000 (-0700) Subject: Fixed possible race condition in LocalFileMoveBatch X-Git-Tag: 1.31.0-rc.0~15621^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=51c173912a548b75c61b4072b2e8da308afb850e;p=lhc%2Fweb%2Fwiklou.git Fixed possible race condition in LocalFileMoveBatch * If a move is blocked by a re-upload and the TRX started outside of LocalFile::lock, then the move did not see the new row in the oldimage table and so it will not move that version of the file in storage. Use the latest DB data to avoid that. Change-Id: I7ec46941170293c96b99a449cb396517108e8b3d --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index a8fa8bd67b..6315fdcd94 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2758,7 +2758,8 @@ class LocalFileMoveBatch { $result = $this->db->select( 'oldimage', array( 'oi_archive_name', 'oi_deleted' ), array( 'oi_name' => $this->oldName ), - __METHOD__ + __METHOD__, + array( 'FOR UPDATE' ) // ignore snapshot ); foreach ( $result as $row ) {