filebackend: Log more details about backend-fail-internal errors
authorGilles Dubuc <gdubuc@wikimedia.org>
Mon, 17 Nov 2014 18:05:52 +0000 (19:05 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 17 Nov 2014 23:36:47 +0000 (23:36 +0000)
Bug: 73094
Change-Id: I9e45284e3cfd55bc34d87009387a2c1766e2db4a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/991

includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/SwiftFileBackend.php

index bfffcc0..8b6eaca 100644 (file)
@@ -314,6 +314,8 @@ class FileBackendMultiWrite extends FileBackend {
                        $mStat = $mBackend->getFileStat( array( 'src' => $mPath, 'latest' => true ) );
                        if ( $mStat === null || ( $mSha1 !== false && !$mStat ) ) { // sanity
                                $status->fatal( 'backend-fail-internal', $this->name );
+                               wfDebugLog( 'FileOperation', __METHOD__
+                                       . ': File is not available on the master backend' );
                                continue; // file is not available on the master backend...
                        }
                        // Check of all clone backends agree with the master...
@@ -326,6 +328,8 @@ class FileBackendMultiWrite extends FileBackend {
                                $cStat = $cBackend->getFileStat( array( 'src' => $cPath, 'latest' => true ) );
                                if ( $cStat === null || ( $cSha1 !== false && !$cStat ) ) { // sanity
                                        $status->fatal( 'backend-fail-internal', $cBackend->getName() );
+                                       wfDebugLog( 'FileOperation', __METHOD__
+                                       . ': File is not available on the clone backend' );
                                        continue; // file is not available on the clone backend...
                                }
                                if ( $mSha1 === $cSha1 ) {
index 625b9b4..7234474 100644 (file)
@@ -537,6 +537,7 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status; // already there
                } elseif ( $stat === null ) {
                        $status->fatal( 'backend-fail-internal', $this->name );
+                       wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
 
                        return $status;
                }
@@ -568,6 +569,7 @@ class SwiftFileBackend extends FileBackendStore {
                        $status->fatal( 'backend-fail-usable', $params['dir'] );
                } else {
                        $status->fatal( 'backend-fail-internal', $this->name );
+                       wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
                }
 
                return $status;
@@ -588,6 +590,7 @@ class SwiftFileBackend extends FileBackendStore {
                        $status->fatal( 'backend-fail-usable', $params['dir'] );
                } else {
                        $status->fatal( 'backend-fail-internal', $this->name );
+                       wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
                }
 
                return $status;
@@ -607,6 +610,7 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status; // ok, nothing to do
                } elseif ( !is_array( $stat ) ) {
                        $status->fatal( 'backend-fail-internal', $this->name );
+                       wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
 
                        return $status;
                }
@@ -1253,6 +1257,7 @@ class SwiftFileBackend extends FileBackendStore {
 
                if ( $rcode != 204 && $rcode !== 202 ) {
                        $status->fatal( 'backend-fail-internal', $this->name );
+                       wfDebugLog( 'SwiftBackend', __METHOD__ . ': unexpected rcode value (' . $rcode . ')' );
                }
 
                return $status;