Merge "Fixed dependencies for jquery.collapsibleTabs"
[lhc/web/wiklou.git] / includes / filebackend / FileBackendStore.php
index 3000d2d..5f562d2 100644 (file)
@@ -834,6 +834,14 @@ 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'] );
+                               trigger_error( "Bad stat cache or race condition for file {$params['src']}." );
+                       }
                } else {
                        $status->fatal( 'backend-fail-stream', $params['src'] );
                }