From 1941cfe369e0bd4170ed54da5e27005636049b28 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 18 Oct 2012 14:58:32 -0700 Subject: [PATCH] [FileBackend] Clear persistent stat cache if it mislead streamFile(). Change-Id: Ie02e9e0c56180d8cbd2507b795cd960f3ba84f33 --- includes/filebackend/FileBackendStore.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index 3000d2d37b..39cfc2d24f 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -834,6 +834,13 @@ abstract class FileBackendStore extends FileBackend { $status = $this->doStreamFile( $params ); wfProfileOut( __METHOD__ . '-send-' . $this->name ); wfProfileOut( __METHOD__ . '-send' ); + if ( !$status->isOK() ) { + // Per bug 41113, nasty things can happen if bad cache entries get + // stuck in cache. It's also possible that this error can come up + // with simple race conditions. Clear out the stat cache to be safe. + $this->clearCache( array( $params['src'] ) ); + $this->deleteFileCache( $params['src'] ); + } } else { $status->fatal( 'backend-fail-stream', $params['src'] ); } -- 2.20.1